Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
trace-error
Advanced tools
npm install trace-error --save
import TraceError from 'trace-error';
global.TraceError = TraceError; // expose globally (optional)
(async () => {
try {
await fetch('google.com');
} catch(e) {
console.error(new TraceError('Failed to fetch content', e));
}
})();
TraceError: Failed to fetch content
at _construct (.../TraceError.js/dist/Exception.js:35:393)
at TraceError.Exception (.../TraceError.js/dist/Exception.js:110:17)
at new TraceError (.../TraceError.js/dist/TraceError.js:186:74)
at .../TraceError.js/tests/throw-test.js:159:19
at Object.<anonymous> (.../TraceError.js/tests/throw-test.js:161:3)
ReferenceError: fetch is not defined
at .../TraceError.js/tests/throw-test.js:157:5
at Object.<anonymous> (.../TraceError.js/tests/throw-test.js:161:3)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
Node >= 4.0; not tested on browsers
TraceError#cause(index = 0)
Get the cause at the specified index
TraceError#causes()
Get a list of all the causes
TraceError@stack
Get the long stack (base error with chained cause errors)
TraceError@messages
Get a list of all the messages
static TraceError@globalStackProperty
Attribute used to aggregate the long stack. Can be further customized via. inheritance and/or prototype modification
static TraceError@indent
Spaces used to indent long stack
More detailed examples are in the /tests
folder
Extend the TraceError as such in order to maximize compatibility with ES5; additionally, override the toJSON
as necessary
export class MyAppTraceError extends TraceError {
constructor(...args) {
super(...args);
// not ideal
Object.defineProperty(this, 'stack', {
get: () => super.stack
});
}
}
FAQs
Chained errors for JavaScript
The npm package trace-error receives a total of 5,924 weekly downloads. As such, trace-error popularity was classified as popular.
We found that trace-error demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.