nickuraltsev / composite-error Goto Github PK
View Code? Open in Web Editor NEWError wrapping in Node.js
License: MIT License
Error wrapping in Node.js
License: MIT License
After creating a composite error, the result is that innerErrors
contains the string messages for all the expected errors.
[
"Term (1.0_15571108706641871406552) referenced in relationship (represent-element) cannot be found.",
"Term (1.0_15571108235121756500925) referenced in relationship (represent-element) cannot be found.",
"Term (1.0_1557110627098-1963619659) referenced in relationship (represent-element) cannot be found.",
"Term (1.0_1557110802238-1919010934) referenced in relationship (represent-element) cannot be found.",
"Term (1.0_15571108133752086874573) referenced in relationship (represent-element) cannot be found."
]
However, the stack contains undefined
for all the steps:
"CompositeError: One or more errors occurred while setting up terminology relatonships from MDR
at Object.refreshTerminologyFromMdr (C:\Code\ncp\study-design-service\src\mdr-service.js:212:11)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async refreshMdrCache (C:\Code\ncp\study-design-service\index.js:70:5)
--- Inner error #0: undefined
--- End of inner error
--- Inner error #1: undefined
--- End of inner error
--- Inner error #2: undefined
--- End of inner error
--- Inner error #3: undefined
--- End of inner error
--- Inner error #4: undefined
--- End of inner error"
I'm getting TypeError: Cannot read property 'call' of undefined
when trying to use this module and printing to console. For example, following the example given in the module:
const firstError = new Error('First error');
const secondError = new CompositeError('Second error', firstError);
const thirdError = new CompositeError('Third error', secondError);
console.log(thirdError.stack);
Prints the following:
TypeError: Cannot read property 'call' of undefined
at CompositeError.get (C:\dev\csp2\frontend\src\csp2\commands\node_modules\composite-error\lib\compositeError.js:44:44)
at CompositeError.formatStackTraces (C:\dev\csp2\frontend\src\csp2\commands\node_modules\composite-error\lib\compositeError.js:55:20)
at CompositeError.get (C:\dev\csp2\frontend\src\csp2\commands\node_modules\composite-error\lib\compositeError.js:24:35)
at repl:1:23
at ContextifyScript.Script.runInThisContext (vm.js:23:33)
at REPLServer.defaultEval (repl.js:340:29)
at bound (domain.js:280:14)
at REPLServer.runBound [as eval] (domain.js:293:12)
at REPLServer.onLine (repl.js:537:10)
at emitOne (events.js:101:20)
My environment:
OS: Windows 10 Pro 64-bit 14393.953
Node: v7.8.0
NPM: v4.2.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.