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

Always throw an exception for a core data error that prevents us from initializing Tracks. #198

Merged
merged 1 commit into from
Mar 10, 2022

Conversation

MichelleTessier
Copy link
Contributor

@MichelleTessier MichelleTessier commented Mar 7, 2022

This PR throws an exception with error information for core data errors that prevent us from initializing tracks, instead of using an abort().

On our first attempt to throw this exception, so that we could get more information in Sentry in the Day One iOS project, @jleandroperez attempted to only throw the exception if NSGetUncaughtExceptionHandler() was nil, hoping to cause minimal changes for other apps that may have employed an exception handler.

However, it appears that at least in the case of the Day One app, NSGetUncaughtExceptionHandler is not nil when we expect it to be, and thus, abort() is called instead of throwing an exception with a more detailed error message.

I suspect this may be related to when Sentry is used. I cannot confirm this in XCode builds, but given that we are seeing the abort() line in Sentry still being called, this is what we expect is happening.

In Day One, in Sentry, we are seeing the abort() line still called here, and thus we are unable to get information about why the data model is not able to set up correctly. We are seeing a large number of crashes (likely happening when the app is in the background) that appear to be caused by this line, so we would like to figure out why this is happening.

…hat in some cases, NSGetUncaughtExceptionHandler is not nil when we expect it to be, and thus we are unable to get information about why the data model is not able to set up correctly
@MichelleTessier MichelleTessier requested review from jleandroperez, astralbodies and bjhomer and removed request for astralbodies March 7, 2022 19:22
Copy link
Contributor

@jleandroperez jleandroperez left a comment

Choose a reason for hiding this comment

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

:shipit:

@MichelleTessier MichelleTessier merged commit 21ded8d into trunk Mar 10, 2022
@MichelleTessier MichelleTessier deleted the michelle/dayone-crash-hunt-exception-fix branch March 10, 2022 16:50
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