Skip to content
Permalink
Browse files

event, feat: handling error for the first trigger.

  • Loading branch information...
xicilion committed Feb 4, 2019
1 parent 293487b commit 02cb480f7aeabec39a93dca68578d93a5776279c
Showing with 6 additions and 1 deletion.
  1. +6 −1 fibjs/include/Trigger.h
@@ -463,8 +463,10 @@ class JSTrigger {
return hr;

if (!ff.IsEmpty()) {
ff->Call(o, argCount, args);
v8::Local<v8::Value> r = ff->Call(o, argCount, args);
retVal = true;
if (r.IsEmpty())
hr = CALL_E_JAVASCRIPT;
}

if (evs.size() > 0) {
@@ -478,6 +480,9 @@ class JSTrigger {
retVal = true;
}

if (hr < 0)
return hr;

return !msg.empty() ? CHECK_ERROR(Runtime::setError(msg)) : 0;
}

0 comments on commit 02cb480

Please sign in to comment.
You can’t perform that action at this time.