Skip to content

Commit

Permalink
fixup! fixup! Handle errors thrown by reportError in queueMicrotask
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Sep 25, 2024
1 parent fcbe289 commit a7dc424
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/workerd/api/global-scope.c++
Original file line number Diff line number Diff line change
Expand Up @@ -718,12 +718,13 @@ void ServiceWorkerGlobalScope::queueMicrotask(jsg::Lock& js, v8::Local<v8::Funct
// If the value is an object that has a stack propery, log that so we get
// the stack trace if it is an exception.
KJ_IF_SOME(obj, val.tryCast<jsg::JsObject>()) {
auto stack = obj.get(js, "stack"_kj);
if (!stack.isUndefined()) {
js.reportError(stack);
return;
auto stack = obj.get(js, "stack"_kj);
if (!stack.isUndefined()) {
js.reportError(stack);
return;
}
} else {} // Here to avoid a compile warning
} else {
} // Here to avoid a compile warning
// Otherwise just log the stringified value generically.
js.reportError(val);
});
Expand Down

0 comments on commit a7dc424

Please sign in to comment.