-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Extend reason message for RCTFatalException
#22532
Conversation
Extend the max length for the `reason` of to 175 characters. Also passes the error `userInfo` to the `NSException`, while appending the untruncated reason to the `userInfo` dictionary.
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Generated by 🚫 dangerJS |
CLA has been signed. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@zackzachariah merged commit 2831d9e into |
Summary: Fixes #22530 As described in the issue, the previous behavior for the `RCTFatal` macro was to truncate the `reason` on the resulting `NSException` to 75 characters. This would ensure the reason would fit on a single line, but resulted in issues debugging errors that occurred in the wild, as many crash logging tools (like Sentry) discard the `name` value of the exception and use the `reason` as their primary identifier. At 75 characters, useful information like the location of the error would usually be truncated. - [x] This extends the truncation threshold to 175 characters, which should be short enough to prevent full-screen-takeover length errors, but long enough to provide useful context to the error. - [x] This adds a `userInfo` value to the resulting `NSException`. It copies over the `userInfo` from the `NSError` passed to the macro, and adds an "untruncated message" value that contains the untruncated version of the `NSException`'s reason. [iOS] [Changed] - RCTFatalExceptions now include more information in their reason and a userInfo. <!-- CATEGORY may be: - [General] - [iOS] - [Android] TYPE may be: - [Added] for new features. - [Changed] for changes in existing functionality. - [Deprecated] for soon-to-be removed features. - [Removed] for now removed features. - [Fixed] for any bug fixes. - [Security] in case of vulnerabilities. For more detail, see https://keepachangelog.com/en/1.0.0/#how MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes. EXAMPLES: [General] [Added] - Add snapToOffsets prop to ScrollView component [General] [Fixed] - Fix various issues in snapToInterval on ScrollView component [iOS] [Fixed] - Fix crash in RCTImagePicker --> Pull Request resolved: #22532 Differential Revision: D13373469 Pulled By: cpojer fbshipit-source-id: ac140d14ce76e1664869437c2c178bdd65ab6e0e
Summary: Fixes #22530 As described in the issue, the previous behavior for the `RCTFatal` macro was to truncate the `reason` on the resulting `NSException` to 75 characters. This would ensure the reason would fit on a single line, but resulted in issues debugging errors that occurred in the wild, as many crash logging tools (like Sentry) discard the `name` value of the exception and use the `reason` as their primary identifier. At 75 characters, useful information like the location of the error would usually be truncated. - [x] This extends the truncation threshold to 175 characters, which should be short enough to prevent full-screen-takeover length errors, but long enough to provide useful context to the error. - [x] This adds a `userInfo` value to the resulting `NSException`. It copies over the `userInfo` from the `NSError` passed to the macro, and adds an "untruncated message" value that contains the untruncated version of the `NSException`'s reason. [iOS] [Changed] - RCTFatalExceptions now include more information in their reason and a userInfo. <!-- CATEGORY may be: - [General] - [iOS] - [Android] TYPE may be: - [Added] for new features. - [Changed] for changes in existing functionality. - [Deprecated] for soon-to-be removed features. - [Removed] for now removed features. - [Fixed] for any bug fixes. - [Security] in case of vulnerabilities. For more detail, see https://keepachangelog.com/en/1.0.0/#how MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes. EXAMPLES: [General] [Added] - Add snapToOffsets prop to ScrollView component [General] [Fixed] - Fix various issues in snapToInterval on ScrollView component [iOS] [Fixed] - Fix crash in RCTImagePicker --> Pull Request resolved: #22532 Differential Revision: D13373469 Pulled By: cpojer fbshipit-source-id: ac140d14ce76e1664869437c2c178bdd65ab6e0e
Summary: Fixes facebook#22530 As described in the issue, the previous behavior for the `RCTFatal` macro was to truncate the `reason` on the resulting `NSException` to 75 characters. This would ensure the reason would fit on a single line, but resulted in issues debugging errors that occurred in the wild, as many crash logging tools (like Sentry) discard the `name` value of the exception and use the `reason` as their primary identifier. At 75 characters, useful information like the location of the error would usually be truncated. - [x] This extends the truncation threshold to 175 characters, which should be short enough to prevent full-screen-takeover length errors, but long enough to provide useful context to the error. - [x] This adds a `userInfo` value to the resulting `NSException`. It copies over the `userInfo` from the `NSError` passed to the macro, and adds an "untruncated message" value that contains the untruncated version of the `NSException`'s reason. [iOS] [Changed] - RCTFatalExceptions now include more information in their reason and a userInfo. <!-- CATEGORY may be: - [General] - [iOS] - [Android] TYPE may be: - [Added] for new features. - [Changed] for changes in existing functionality. - [Deprecated] for soon-to-be removed features. - [Removed] for now removed features. - [Fixed] for any bug fixes. - [Security] in case of vulnerabilities. For more detail, see https://keepachangelog.com/en/1.0.0/#how MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes. EXAMPLES: [General] [Added] - Add snapToOffsets prop to ScrollView component [General] [Fixed] - Fix various issues in snapToInterval on ScrollView component [iOS] [Fixed] - Fix crash in RCTImagePicker --> Pull Request resolved: facebook#22532 Differential Revision: D13373469 Pulled By: cpojer fbshipit-source-id: ac140d14ce76e1664869437c2c178bdd65ab6e0e
Background
Fixes #22530
As described in the issue, the previous behavior for the
RCTFatal
macro was to truncate thereason
on the resultingNSException
to 75 characters. This would ensure the reason would fit on a single line, but resulted in issues debugging errors that occurred in the wild, as many crash logging tools (like Sentry) discard thename
value of the exception and use thereason
as their primary identifier. At 75 characters, useful information like the location of the error would usually be truncated.Detailed Changes
userInfo
value to the resultingNSException
. It copies over theuserInfo
from theNSError
passed to the macro, and adds an "untruncated message" value that contains the untruncated version of theNSException
's reason.Changelog:
[iOS] [Changed] - RCTFatalExceptions now include more information in their reason and a userInfo.