Skip to content
This repository has been archived by the owner on Feb 23, 2020. It is now read-only.

graph-cli build: Improve Module Load Failure Handling #37

Open
dOrgJelli opened this issue Jan 18, 2020 · 0 comments
Open

graph-cli build: Improve Module Load Failure Handling #37

dOrgJelli opened this issue Jan 18, 2020 · 0 comments

Comments

@dOrgJelli
Copy link
Member

Currently if there's a problem when loading the module, graph-cli only reports back the message field of the error object, which leads to lost information. Here's an example:
console.log(error):

import gql from "graphql-tag";
       ^^^

SyntaxError: Unexpected identifier
    at new Script (vm.js:80:7)
    at createScript (vm.js:274:10)
    at Object.runInThisContext (vm.js:326:10)
    at Module._compile (internal/modules/cjs/loader.js:664:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)

VS

console.log(error.message):

Unexpected identifier
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant