diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-04-19 16:22:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-19 16:22:41 +0200 |
commit | 5a77bb884416753b85f2acecd4895c75f1c53187 (patch) | |
tree | 1c8e569abed59c3b89cbd79342330142ce08c8b1 /core/01_core.js | |
parent | 36cfb2fdbb721c9d97e7785908d3d0ab27bd51b6 (diff) |
refactor(core): return better error for non-existent async ops (#18772)
Diffstat (limited to 'core/01_core.js')
-rw-r--r-- | core/01_core.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/01_core.js b/core/01_core.js index a2cd9e14b..a8bdeb2a8 100644 --- a/core/01_core.js +++ b/core/01_core.js @@ -20,6 +20,7 @@ PromisePrototypeThen, RangeError, ReferenceError, + ReflectHas, SafeArrayIterator, SafeMap, SafePromisePrototypeFinally, @@ -235,6 +236,9 @@ } catch (err) { // Cleanup the just-created promise getPromise(id); + if (!ReflectHas(ops, name)) { + throw new TypeError(`${name} is not a registered op`); + } // Rethrow the error throw err; } @@ -257,6 +261,9 @@ } catch (err) { // Cleanup the just-created promise getPromise(id); + if (!ReflectHas(ops, name)) { + throw new TypeError(`${name} is not a registered op`); + } // Rethrow the error throw err; } |