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

Replace all exception to android.database.sqlite package #556

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

allenhsu-17live
Copy link

Changes proposed in this pull request:

Replace all exception to android.database.sqlite package

@brody4hire
Copy link

Looks like a nice proposal ... is there anything we can do to help move this forward?

@developernotes
Copy link
Member

Hi @allenhsu-17live

I'm sorry for the delay in response; thank you for your interest in SQLCipher! We have discussed this internally and feel that this specific change may potentially impact a large number of users since as it is fairly common practice for users to catch net.sqlcipher.database.SQLiteException.

It appears the issue you are experiencing is due to the Room API catching android.database.sqlite.SQLiteException and thus our exception is not caught. What would you think about changing the net.sqlcipher.SQLException to extend android.database.SQLException instead of RuntimeException? I believe this should adjust the inheritance hierarchy to allow our exception to be caught within the Room API, whilst not impacting the exception type all other SQLCipher for Android users catch against.

If you feel this proposed adjustment would fulfill your needs, would you consider revising your pull request to the more limited change suggested above? Please let me know your thoughts. Thanks!

@brody4hire
Copy link

changing the net.sqlcipher.SQLException to extend android.database.SQLException

Shouldn't net.sqlcipher.SQLException extend android.database.sqlite.SQLiteException for the Room API?

@developernotes
Copy link
Member

Hi @brodybits,

Shouldn't net.sqlcipher.SQLException extend android.database.sqlite.SQLiteException for the Room API?

Since SQLCipher for Android is supposed to be an alternative to the android.database.sqlite package in terms of classes, and within the Android class model android.database.sqlite.SQLiteException extends android.database.SQLException which in turns extends RuntimeException, I think it would be more consistent for net.zetetic.SQLException to extend android.database.SQLException, and then maintain the existing inheritance hierarchy in that net.zetetic.database.SQLiteException extends net.zetetic.SQLException.

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.

3 participants