Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid show confusing lines in gen/bundle/main.js that throws error #1502

Merged
merged 1 commit into from
Jan 12, 2019

Conversation

kevinkassimo
Copy link
Contributor

Avoid show confusing lines in gen/bundle/main.js that throws error.
Also uses as_ref avoid some unneeded clones.

For a file bad_import.ts:

import "non-existent.txt";

Run deno bad_import.ts:
Before:

gen/bundle/main.js:4339:17
          return new DenoError(kind, base.error());

NotFound: Cannot resolve module "non-existent.txt" from "/Users/kevinqian/Desktop/Programming/Deno/test/bad_import.ts"
    at DenoError (deno/js/errors.ts:19:5)
    at maybeError (deno/js/errors.ts:38:12)
    at maybeThrowError (deno/js/errors.ts:26:15)
    at sendSync (deno/js/dispatch.ts:67:5)
    at codeFetch (deno/js/os.ts:46:19)
    at resolveModule (deno/js/compiler.ts:357:38)
    at moduleNames.map.name (deno/js/compiler.ts:519:31)
    at resolveModuleNames (deno/js/compiler.ts:511:24)
    at compilerHost.resolveModuleNames (deno/third_party/node_modules/typescript/lib/typescript.js:32750:71)
    at resolveModuleNamesWorker (deno/third_party/node_modules/typescript/lib/typescript.js:20688:69)

After:

NotFound: Cannot resolve module "non-existent.txt" from "/Users/kevinqian/Desktop/Programming/Deno/test/bad_import.ts"
    at DenoError (deno/js/errors.ts:19:5)
    at maybeError (deno/js/errors.ts:38:12)
    at maybeThrowError (deno/js/errors.ts:26:15)
    at sendSync (deno/js/dispatch.ts:67:5)
    at codeFetch (deno/js/os.ts:46:19)
    at resolveModule (deno/js/compiler.ts:357:38)
    at moduleNames.map.name (deno/js/compiler.ts:519:31)
    at resolveModuleNames (deno/js/compiler.ts:511:24)
    at compilerHost.resolveModuleNames (deno/third_party/node_modules/typescript/lib/typescript.js:32750:71)
    at resolveModuleNamesWorker (deno/third_party/node_modules/typescript/lib/typescript.js:20688:69)

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool thanks for the clean up. I’m not sure if this is the best herutistics but I think we just have to iterate on it in order to improve stack traces.

LGTM

@ry ry merged commit e29a676 into denoland:master Jan 12, 2019
@kevinkassimo kevinkassimo deleted the errors/no_internal_line branch December 27, 2019 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants