You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
侯晓宇
0cb2601919
|
4 weeks ago | |
---|---|---|
.. | ||
dist | 4 weeks ago | |
LICENSE | 4 weeks ago | |
README.md | 4 weeks ago | |
error-stack-parser.d.ts | 4 weeks ago | |
error-stack-parser.js | 4 weeks ago | |
package.json | 4 weeks ago |
README.md
error-stack-parser.js - Extract meaning from JS Errors
Simple, cross-browser Error parser.
This library parses and extracts function names, URLs, line numbers, and column numbers from the given Error's stack
as
an Array of StackFrames.
Once you have parsed out StackFrames, you can do much more interesting things. See stacktrace-gps.
Note that in IE9 and earlier, Error
objects don't have enough information to extract much of anything. In IE 10, Error
s
are given a stack
once they're throw
n.
Browser Support
Usage
ErrorStackParser.parse(new Error('BOOM'));
=> [
StackFrame({functionName: 'foo', args: [], fileName: 'path/to/file.js', lineNumber: 35, columnNumber: 79, isNative: false, isEval: false}),
StackFrame({functionName: 'Bar', fileName: 'https://cdn.somewherefast.com/utils.min.js', lineNumber: 1, columnNumber: 832, isNative: false, isEval: false, isConstructor: true}),
StackFrame(... and so on ...)
]
Installation
npm install error-stack-parser
bower install error-stack-parser
https://raw.githubusercontent.com/stacktracejs/error-stack-parser/master/dist/error-stack-parser.min.js
Contributing
Want to be listed as a Contributor? Start with the Contributing Guide!