Trace shouldn't contain stacktrace.js internals #65

Closed
fresheneesz opened this Issue Jan 23, 2014 · 8 comments

4 participants

@fresheneesz

The library should remove the parts of the stack that are stactrace.js internals - that won't be useful information to anybody.

@victor-homyakov

👍 this could be implemented as stack frame filter, it'll give possibility to exclude any libraries eg. jquery, underscore etc.

@fresheneesz

Why not just always tear off the top 3 lines? A stack frame filter will still require people to explicitly work out how to filter it every time. Wouldn't it be better to just never output those parts of the stack?

@eriwen
stacktrace.js member

Perhaps a configurable filter that defaults to excluding only stacktrace.js functions. Extra points if we can filter on file names as well.

@victor-homyakov

@fresheneesz because top 3 lines shouldn't necessarily contain code from stacktrace.js, e.g. when processing captured exception. OTOH filter may have stacktrace.js or its function names as default value.

@fresheneesz

Yes of course, in that case it shouldn't strip any lines. Isn't that, in fact, the only time when the top 3 lines won't contain code from stacktrace.js?

@victor-homyakov

Absolutely right. But I prefer to not to implement it with if (!exception) {skip 3 lines}. Especially when there is a possibility of more universal and reusable solution.

@fresheneesz

Fair enough then. Though, if it were me running the project, I would consider filtering to be completely unrelated to a module for getting stacktraces. Definitely is up to you tho.

@marcuswhit

Agree, I was surprised to see printStackTrace internals in the resulting stacktrace - it's completely irrelevant.

@eriwen eriwen added this to the 1.0 milestone Sep 1, 2014
@eriwen eriwen pushed a commit that closed this issue Nov 28, 2014
Eric Wendelin Implement StackTrace.fromError using ES6Promise.
Use StackTraceGPS for source map support for #44.
Filter out stacktrace.js internals by default fixes #65.
3f1c690
@eriwen eriwen closed this in 3f1c690 Nov 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment