Skip to content

Add option to skip more frames using report - #58

Merged
steren merged 1 commit into
GoogleCloudPlatform:masterfrom
bz2:skip_local_frames
Dec 11, 2018
Merged

steren merged 1 commit into
GoogleCloudPlatform:masterfrom
bz2:skip_local_frames

Conversation

@bz2

@bz2 bz2 commented Dec 7, 2018

Copy link
Copy Markdown
Contributor

New options parameter on report() for per-call config.

Add skipLocalFrames option to trim the head of a locally generated
stacktrace to remove more than one level.

Enforce valid jsdoc using eslint and add params for test helpers.

Add documentation for passing options to report().

@bz2 bz2 mentioned this pull request Dec 7, 2018
8 of 9 tasks
New options parameter on report() for per-call config.

Add skipLocalFrames option to trim the head of a locally generated
stacktrace to remove more than one level.

Enforce valid jsdoc using eslint and add params for test helpers.

Add documentation for passing options to report().
@bz2
bz2 force-pushed the skip_local_frames branch from 9b0437a to 5739955 Compare December 7, 2018 23:01
@steren

steren commented Dec 9, 2018

Copy link
Copy Markdown
Contributor

Thanks.
What is the use case for skipping frames? Can you add this to the README?

I suppose it is to remove frames of local error reporter frameworks, in which case, would it be better to be able to exclude frames based on some function or filename pattern, instead of an hard coded number?

@bz2

bz2 commented Dec 10, 2018

Copy link
Copy Markdown
Contributor Author

Yes, this is a similar use case to filtering based on frame location. See the README change for an example.

There is an options argument for StackTrace.fromError() that can be used to override its internal filter, with two niggles:

  • The current module-level filtering relies on a naming scheme being used for all functions.
  • The default filter is not exported, so would need to be copied to add to the logic.

Basically, this change is a low-friction way of making logged stacks a bit nicer, rather than a complete solution.

@steren
steren merged commit db5fec3 into GoogleCloudPlatform:master Dec 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants