You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been using the 0.6 versions of stacktrace-js, but I was getting a warning from chrome about synchronous requests from the main thread being deprecated, so I am investigating updating to the new version.
The case I have is I want to augment a logging module to prefix the file:line:column to each log message, but because of the asynchronous nature of the interface that stacktrace-js exposes, it doesn't seem possible to do it.
I have hacked at the fromError method to remove the asynchronous interface and just return the stack frame array, and it seems to work, but I am no longer calling into the GPS module. I guess it's the GPS module that needs to download the source map.
It would be good to also provide an synchronous interface, e.g.:
70 /**
71 * Given an error object, parse it synchronously without source mapping.
72 * @param error Error object
73 * @param opts Object for options
74 * @return Array[StackFrame]
75 */
76 getStackFrames: function StackTrack$$getStackFrames(error, opts) {
77 opts = _merge(_options, opts);
78
79 var stackframes = ErrorStackParser.parse(error);
80
81 if (typeof opts.filter === 'function') {
82 stackframes = stackframes.filter(opts.filter);
83 }
84
85 return stackframes;
86 },
Sorry, I meant to file this issue against stacktrace-js, not stacktrace-gps.
The text was updated successfully, but these errors were encountered:
@elesueur If all you want to do is parse an Error (and not enhance it with source maps, etc.) then error-stack-parser is for you. It does exactly what you describe!
Please let us know if I misunderstood your request or error-stack-parser doesn't do everything you want.
I have been using the 0.6 versions of stacktrace-js, but I was getting a warning from chrome about synchronous requests from the main thread being deprecated, so I am investigating updating to the new version.
The case I have is I want to augment a logging module to prefix the file:line:column to each log message, but because of the asynchronous nature of the interface that stacktrace-js exposes, it doesn't seem possible to do it.
I have hacked at the fromError method to remove the asynchronous interface and just return the stack frame array, and it seems to work, but I am no longer calling into the GPS module. I guess it's the GPS module that needs to download the source map.
It would be good to also provide an synchronous interface, e.g.:
70 /**
71 * Given an error object, parse it synchronously without source mapping.
72 * @param error Error object
73 * @param opts Object for options
74 * @return Array[StackFrame]
75 */
76 getStackFrames: function StackTrack$$getStackFrames(error, opts) {
77 opts = _merge(_options, opts);
78
79 var stackframes = ErrorStackParser.parse(error);
80
81 if (typeof opts.filter === 'function') {
82 stackframes = stackframes.filter(opts.filter);
83 }
84
85 return stackframes;
86 },
Sorry, I meant to file this issue against stacktrace-js, not stacktrace-gps.
The text was updated successfully, but these errors were encountered: