From 9712e0c31582b5052e7e647f694af1f7bccad0b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 26 Nov 2019 18:14:04 +0100 Subject: better error messages for 'relative import path not prefixed with / or ./ or ../' (#3405) --- cli/deno_error.rs | 2 +- cli/tests/error_011_bad_module_specifier.ts.out | 2 +- cli/tests/error_012_bad_dynamic_import_specifier.ts.out | 2 +- cli/tests/error_014_catch_dynamic_import_error.js.out | 4 ++-- cli/tests/error_type_definitions.ts.out | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'cli') diff --git a/cli/deno_error.rs b/cli/deno_error.rs index 346149cd1..b16fb3fa6 100644 --- a/cli/deno_error.rs +++ b/cli/deno_error.rs @@ -140,7 +140,7 @@ impl GetErrorKind for ModuleResolutionError { match self { InvalidUrl(ref err) | InvalidBaseUrl(ref err) => err.kind(), InvalidPath(_) => ErrorKind::InvalidPath, - ImportPrefixMissing(_) => ErrorKind::ImportPrefixMissing, + ImportPrefixMissing(_, _) => ErrorKind::ImportPrefixMissing, } } } diff --git a/cli/tests/error_011_bad_module_specifier.ts.out b/cli/tests/error_011_bad_module_specifier.ts.out index 0a90cd32c..276443e5b 100644 --- a/cli/tests/error_011_bad_module_specifier.ts.out +++ b/cli/tests/error_011_bad_module_specifier.ts.out @@ -1,4 +1,4 @@ -[WILDCARD]error: Uncaught ImportPrefixMissing: relative import path "bad-module.ts" not prefixed with / or ./ or ../ +[WILDCARD]error: Uncaught ImportPrefixMissing: relative import path "bad-module.ts" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/error_011_bad_module_specifier.ts" [WILDCARD]dispatch_json.ts:[WILDCARD] at DenoError ([WILDCARD]errors.ts:[WILDCARD]) at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD]) diff --git a/cli/tests/error_012_bad_dynamic_import_specifier.ts.out b/cli/tests/error_012_bad_dynamic_import_specifier.ts.out index 0a90cd32c..52e5b913e 100644 --- a/cli/tests/error_012_bad_dynamic_import_specifier.ts.out +++ b/cli/tests/error_012_bad_dynamic_import_specifier.ts.out @@ -1,4 +1,4 @@ -[WILDCARD]error: Uncaught ImportPrefixMissing: relative import path "bad-module.ts" not prefixed with / or ./ or ../ +[WILDCARD]error: Uncaught ImportPrefixMissing: relative import path "bad-module.ts" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/error_012_bad_dynamic_import_specifier.ts" [WILDCARD]dispatch_json.ts:[WILDCARD] at DenoError ([WILDCARD]errors.ts:[WILDCARD]) at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD]) diff --git a/cli/tests/error_014_catch_dynamic_import_error.js.out b/cli/tests/error_014_catch_dynamic_import_error.js.out index c18b680a1..1a2ab2fd8 100644 --- a/cli/tests/error_014_catch_dynamic_import_error.js.out +++ b/cli/tests/error_014_catch_dynamic_import_error.js.out @@ -1,8 +1,8 @@ Caught direct dynamic import error. -TypeError: relative import path "does not exist" not prefixed with / or ./ or ../ +TypeError: relative import path "does not exist" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/error_014_catch_dynamic_import_error.js" Caught indirect direct dynamic import error. -TypeError: relative import path "does not exist either" not prefixed with / or ./ or ../ +TypeError: relative import path "does not exist either" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/indirect_import_error.js" Caught error thrown by dynamically imported module. Error: An error diff --git a/cli/tests/error_type_definitions.ts.out b/cli/tests/error_type_definitions.ts.out index d0b599862..e21b6d794 100644 --- a/cli/tests/error_type_definitions.ts.out +++ b/cli/tests/error_type_definitions.ts.out @@ -1,4 +1,4 @@ -[WILDCARD]error: Uncaught ImportPrefixMissing: relative import path "baz" not prefixed with / or ./ or ../ +[WILDCARD]error: Uncaught ImportPrefixMissing: relative import path "baz" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/type_definitions/bar.d.ts" [WILDCARD]dispatch_json.ts:[WILDCARD] at DenoError ([WILDCARD]errors.ts:[WILDCARD]) at unwrapResponse ([WILDCARD]dispatch_json.ts:[WILDCARD]) -- cgit v1.2.3