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

feat(core) : Truncate the cause message to a maxLengthValue of 250 #8592

Conversation

ziyad-elabid-nw
Copy link
Contributor

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

@ziyad-elabid-nw
Copy link
Contributor Author

Related to this issue : #8580

@ziyad-elabid-nw ziyad-elabid-nw force-pushed the fix/truncate-cause-message-to-max-length-value branch 2 times, most recently from d6722a7 to 20f43a3 Compare July 19, 2023 16:35
@ziyad-elabid-nw ziyad-elabid-nw force-pushed the fix/truncate-cause-message-to-max-length-value branch from 20f43a3 to a0ce78d Compare July 19, 2023 16:45
@Lms24
Copy link
Member

Lms24 commented Jul 20, 2023

Hi @ziyad-elabid-nw, seems like we were working on the same issue at the same time (#8593) 😅

I believe #8593 solves this more generally, not just for the react error boundary. AFAICT the error boundary basically relies on the LinkedErrors integration to process the error into a Sentry event. I'll leave this open in the meantime though until things are reviewed.

Regardless, thanks for contributing! :)

@@ -79,6 +80,7 @@ function setCause(error: Error & { cause?: Error }, cause: Error): void {
seenErrors.set(error, true);
return recurse(error.cause, cause);
}
cause.message = truncate(cause.message, MAX_VALUE_LENGTH);
Copy link
Member

Choose a reason for hiding this comment

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

No action required at this time, see my other comment but:

The maxValueLength can be configured in the SDK's init options. We should respect that and only fall back to MAX_VALUE_LENGTH if the option is not set.

@ziyad-elabid-nw
Copy link
Contributor Author

Hi @ziyad-elabid-nw, seems like we were working on the same issue at the same time (#8593) 😅

I believe #8593 solves this more generally, not just for the react error boundary. AFAICT the error boundary basically relies on the LinkedErrors integration to process the error into a Sentry event. I'll leave this open in the meantime though until things are reviewed.

Regardless, thanks for contributing! :)

Hello @Lms24, i took a glance on your PR, i got what you mean 👍 better to close it

Have a nice day 💯

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