Emit autoUpdater error directly as Error object
This commit is contained in:
parent
423dd4d57a
commit
13e4582697
1 changed files with 4 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include "atom/browser/browser.h"
|
#include "atom/browser/browser.h"
|
||||||
#include "atom/browser/native_window.h"
|
#include "atom/browser/native_window.h"
|
||||||
#include "atom/browser/window_list.h"
|
#include "atom/browser/window_list.h"
|
||||||
|
#include "atom/common/api/event_emitter_caller.h"
|
||||||
#include "atom/common/native_mate_converters/callback.h"
|
#include "atom/common/native_mate_converters/callback.h"
|
||||||
#include "atom/common/node_includes.h"
|
#include "atom/common/node_includes.h"
|
||||||
#include "base/time/time.h"
|
#include "base/time/time.h"
|
||||||
|
@ -47,7 +48,9 @@ void AutoUpdater::OnError(const std::string& message) {
|
||||||
v8::Locker locker(isolate());
|
v8::Locker locker(isolate());
|
||||||
v8::HandleScope handle_scope(isolate());
|
v8::HandleScope handle_scope(isolate());
|
||||||
auto error = v8::Exception::Error(mate::StringToV8(isolate(), message));
|
auto error = v8::Exception::Error(mate::StringToV8(isolate(), message));
|
||||||
EmitCustomEvent(
|
mate::EmitEvent(
|
||||||
|
isolate(),
|
||||||
|
GetWrapper(),
|
||||||
"error",
|
"error",
|
||||||
error->ToObject(isolate()->GetCurrentContext()).ToLocalChecked(),
|
error->ToObject(isolate()->GetCurrentContext()).ToLocalChecked(),
|
||||||
// Message is also emitted to keep compatibility with old code.
|
// Message is also emitted to keep compatibility with old code.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue