Skip to content

Commit

Permalink
Set name to AbortError
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Nov 19, 2022
1 parent 3237cee commit 59aa794
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1758,8 +1758,10 @@ struct NextWorker final : public BaseWorker {

void HandleOKCallback (napi_env env, napi_deferred deferred) override {
if (iterator_->aborted_) {
// TODO: set name to AbortError (see abstract-level)
napi_value err = CreateCodeError(env, "LEVEL_ABORTED", "Operation has been aborted");
napi_value name;
napi_create_string_utf8(env, "AbortError", NAPI_AUTO_LENGTH, &name);
napi_set_named_property(env, err, "name", name);
napi_reject_deferred(env, deferred, err);
return;
}
Expand Down

0 comments on commit 59aa794

Please sign in to comment.