Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ [RUMF-921] differentiate handled and unhandled errors #886

Merged

Conversation

amortemousque
Copy link
Collaborator

@amortemousque amortemousque commented Jun 9, 2021

Motivation

In the context of RUM, an error is considered handled as long as it has been reported manually in the code (e.g console.error, rumAgent.addError). Errors collected through global error/exception listeners are considered unhandled.
This new tag differentiate handled and unhandled errors.

Changes

Add handling flag to all errors reported by RUM except Network and Agent errors

Testing

Unit, Locally


I have gone over the contributing documentation.

@amortemousque amortemousque requested a review from a team as a code owner June 9, 2021 09:26
@amortemousque amortemousque changed the title ✨ differentiate handled and unhandled errors ✨ [RUMF-921] differentiate handled and unhandled errors Jun 9, 2021
@amortemousque amortemousque marked this pull request as draft June 9, 2021 09:27
Copy link
Member

@BenoitZugmeyer BenoitZugmeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM so far :)

@codecov-commenter
Copy link

Codecov Report

Merging #886 (d7853c8) into main (8d93832) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #886      +/-   ##
==========================================
+ Coverage   89.09%   89.12%   +0.03%     
==========================================
  Files          81       81              
  Lines        3787     3790       +3     
  Branches      845      846       +1     
==========================================
+ Hits         3374     3378       +4     
+ Misses        413      412       -1     
Impacted Files Coverage Δ
...ckages/core/src/domain/automaticErrorCollection.ts 86.20% <ø> (ø)
packages/rum-core/src/rawRumEvent.types.ts 100.00% <ø> (ø)
packages/rum-core/test/fixtures.ts 100.00% <ø> (ø)
packages/core/src/tools/error.ts 100.00% <100.00%> (ø)
...omain/rumEventsCollection/error/errorCollection.ts 82.60% <100.00%> (ø)
packages/core/src/tools/timeUtils.ts 93.93% <0.00%> (+3.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d93832...d7853c8. Read the comment docs.

@amortemousque amortemousque force-pushed the aymeric/differentiate-handled-and-not—handled-errors branch from d7853c8 to cceb0e7 Compare June 11, 2021 10:29
@amortemousque amortemousque marked this pull request as ready for review June 11, 2021 10:31
/**
* Whether the error has been handled manually in the source code or not
*/
readonly handling?: 'handled' | 'unhandled'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also add this field to logs error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've asked Maxime and for him, it's good enough for now.

Copy link
Contributor

@bcaudan bcaudan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@amortemousque amortemousque merged commit a846216 into main Jun 14, 2021
@bcaudan bcaudan deleted the aymeric/differentiate-handled-and-not—handled-errors branch September 13, 2021 08:06
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.

4 participants