Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Improved exception handling on Android #759

Closed
wants to merge 2 commits into from

Conversation

shamilovtim
Copy link
Contributor

Proposed changes

Instead of matching exception class simple names to an error codes I've updated the code to match the exception class to the error codes.

The issue we discovered was that ProGuard would obfuscate the class simple names. This would cause the error code lookup table to always miss and throw a NullPointerException.

An alternative solution would have been to adjust our ProGuard rules to prevent obfuscating. While this would fix the issue this wouldn't help anybody else running into this.

Additionally, I didn't like that when the lookup table missed a non-descript NullPointerException would be thrown. I've updated that to simply rethrow the error so that crash logs will at least have the root cause error rather than the non-descript NullPointerException.

Types of changes

  • Bugfix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)

Checklist

  • I have added tests that prove my fix is useful or that my feature works
  • I have added necessary documentation (if appropriate)
  • I know that my PR will be merged only if it has tests and they pass

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants