win: Add ELECTRON_DEFAULT_ERROR_MODE env
It is useful to help debugging crashes without opening debugger.
This commit is contained in:
parent
863199348f
commit
acf4372cf7
1 changed files with 9 additions and 0 deletions
|
@ -14,6 +14,7 @@
|
|||
#include "atom/common/node_includes.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/base_paths.h"
|
||||
#include "base/environment.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/path_service.h"
|
||||
|
@ -141,6 +142,14 @@ void NodeBindings::Initialize() {
|
|||
// Init node.
|
||||
// (we assume node::Init would not modify the parameters under embedded mode).
|
||||
node::Init(nullptr, nullptr, nullptr, nullptr);
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// uv_init overrides error mode to suppress the default crash dialog, bring
|
||||
// it back if user wants to show it.
|
||||
scoped_ptr<base::Environment> env(base::Environment::Create());
|
||||
if (env->HasVar("ELECTRON_DEFAULT_ERROR_MODE"))
|
||||
SetErrorMode(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
node::Environment* NodeBindings::CreateEnvironment(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue