Pass real Error object in error event
This commit is contained in:
parent
d5c964c68c
commit
95fe4beda8
2 changed files with 10 additions and 4 deletions
|
@ -23,8 +23,15 @@ AutoUpdater::~AutoUpdater() {
|
||||||
auto_updater::AutoUpdater::SetDelegate(NULL);
|
auto_updater::AutoUpdater::SetDelegate(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoUpdater::OnError(const std::string& error) {
|
void AutoUpdater::OnError(const std::string& message) {
|
||||||
Emit("error", error);
|
v8::Locker locker(isolate());
|
||||||
|
v8::HandleScope handle_scope(isolate());
|
||||||
|
auto error = v8::Exception::Error(mate::StringToV8(isolate(), message));
|
||||||
|
EmitCustomEvent(
|
||||||
|
"error",
|
||||||
|
error->ToObject(isolate()->GetCurrentContext()).ToLocalChecked(),
|
||||||
|
// Message is also emitted to keep compatibility with old code.
|
||||||
|
message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoUpdater::OnCheckingForUpdate() {
|
void AutoUpdater::OnCheckingForUpdate() {
|
||||||
|
|
|
@ -110,8 +110,7 @@ The `autoUpdater` object emits the following events:
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
* `event` Event
|
* `error` Error
|
||||||
* `message` String
|
|
||||||
|
|
||||||
Emitted when there is an error while updating.
|
Emitted when there is an error while updating.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue