refactor(cli/js): Replace constructError() with getErrorClass() (#4189)

Flattens dispatch error handling to produce one less useless stack frame on op errors.
This commit is contained in:
Nayeem Rahman 2020-02-29 18:04:10 +00:00 committed by GitHub
parent f55b22e195
commit 1f9d158bdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 32 additions and 39 deletions

View file

@ -1,7 +1,6 @@
[WILDCARD]
error: Uncaught BadResource: bad resource id
[WILDCARD]errors.ts:[WILDCARD]
[WILDCARD]dispatch_json.ts:[WILDCARD]
at BadResource ([WILDCARD]errors.ts:[WILDCARD])
at constructError ([WILDCARD]errors.ts:[WILDCARD])
at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD])
at sendAsync ([WILDCARD]dispatch_json.ts:[WILDCARD])

View file

@ -1,6 +1,5 @@
[WILDCARD]error: Uncaught NotFound: Cannot resolve module "[WILDCARD]/bad-module.ts" from "[WILDCARD]/error_004_missing_module.ts"
[WILDCARD]errors.ts:[WILDCARD]
[WILDCARD]dispatch_json.ts:[WILDCARD]
at NotFound ([WILDCARD]errors.ts:[WILDCARD])
at constructError ([WILDCARD]errors.ts:[WILDCARD])
at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD])
at sendAsync[WILDCARD] ([WILDCARD]dispatch_json.ts:[WILDCARD])

View file

@ -1,6 +1,5 @@
[WILDCARD]error: Uncaught NotFound: Cannot resolve module "[WILDCARD]/bad-module.ts" from "[WILDCARD]/error_005_missing_dynamic_import.ts"
[WILDCARD]errors.ts:[WILDCARD]
[WILDCARD]dispatch_json.ts:[WILDCARD]
at NotFound ([WILDCARD]errors.ts:[WILDCARD])
at constructError ([WILDCARD]errors.ts:[WILDCARD])
at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD])
at sendAsync[WILDCARD] ([WILDCARD]dispatch_json.ts:[WILDCARD])

View file

@ -1,6 +1,5 @@
[WILDCARD]error: Uncaught NotFound: Cannot resolve module "[WILDCARD]/non-existent" from "[WILDCARD]/error_006_import_ext_failure.ts"
[WILDCARD]errors.ts:[WILDCARD]
[WILDCARD]dispatch_json.ts:[WILDCARD]
at NotFound ([WILDCARD]errors.ts:[WILDCARD])
at constructError ([WILDCARD]errors.ts:[WILDCARD])
at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD])
at sendAsync[WILDCARD] ([WILDCARD]dispatch_json.ts:[WILDCARD])

View file

@ -1,6 +1,5 @@
[WILDCARD]error: Uncaught URIError: relative import path "bad-module.ts" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/error_011_bad_module_specifier.ts"
[WILDCARD]errors.ts:[WILDCARD]
at constructError ($deno$/errors.ts:[WILDCARD])
[WILDCARD]dispatch_json.ts:[WILDCARD]
at unwrapResponse ($deno$/dispatch_json.ts:[WILDCARD])
at sendSync ($deno$/dispatch_json.ts:[WILDCARD])
at resolveModules ($deno$/compiler_imports.ts:[WILDCARD])

View file

@ -1,6 +1,5 @@
[WILDCARD]error: Uncaught URIError: relative import path "bad-module.ts" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/error_012_bad_dynamic_import_specifier.ts"
[WILDCARD]errors.ts:[WILDCARD]
at constructError ($deno$/errors.ts:[WILDCARD])
[WILDCARD]dispatch_json.ts:[WILDCARD]
at unwrapResponse ($deno$/dispatch_json.ts:[WILDCARD])
at sendSync ($deno$/dispatch_json.ts:[WILDCARD])
at resolveModules ($deno$/compiler_imports.ts:[WILDCARD])

View file

@ -1,6 +1,5 @@
[WILDCARD]error: Uncaught URIError: relative import path "baz" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/type_definitions/bar.d.ts"
[WILDCARD]errors.ts:[WILDCARD]
at constructError ($deno$/errors.ts:[WILDCARD])
[WILDCARD]dispatch_json.ts:[WILDCARD]
at unwrapResponse ($deno$/dispatch_json.ts:[WILDCARD])
at sendSync ($deno$/dispatch_json.ts:[WILDCARD])
at resolveModules ($deno$/compiler_imports.ts:[WILDCARD])