feat(replay): Add onError callback + other small improvements to debugging#13721
Merged
feat(replay): Add onError callback + other small improvements to debugging#13721
onError callback + other small improvements to debugging#13721Conversation
…bugging * Adds an `onError` callback for replay SDK exceptions * Do not log empty messages when calling `logger.exception` * Send `ratelimit_backoff` client report when necessary (instead of generic `send_error`)
Contributor
size-limit report 📦
|
billyvg
commented
Sep 18, 2024
| if (DEBUG_BUILD && options._experiments && options._experiments.captureExceptions) { | ||
| captureException(err); | ||
| if (onError) { | ||
| onError(err); |
Member
Author
There was a problem hiding this comment.
I wanted to propagate this up so that we're always using the same error capturing logic (e.g. replay.handleException)
c298lee
approved these changes
Sep 18, 2024
mydea
reviewed
Sep 19, 2024
mydea
reviewed
Sep 19, 2024
|
|
||
| _logger.exception = (error: unknown, ...message: unknown[]) => { | ||
| if (_logger.error) { | ||
| if (message && _logger.error) { |
Member
There was a problem hiding this comment.
I think message will never be undefined, but an empty array? so this should probably be:
Suggested change
| if (message && _logger.error) { | |
| if (message.length && _logger.error) { |
🤔 ?
Member
Author
There was a problem hiding this comment.
Ah good catch, added some tests :)
mydea
approved these changes
Sep 19, 2024
billyvg
added a commit
that referenced
this pull request
Oct 16, 2024
This fixes the `onError` callback added in #13721 -- the option itself was not being propagated to the replay options.
billyvg
added a commit
that referenced
this pull request
Oct 24, 2024
This fixes the `onError` callback added in #13721 -- the option itself was not being propagated to the replay options.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
onErrorcallback for replay SDK exceptionslogger.exceptionratelimit_backoffclient report when necessary (instead of genericsend_error)