yahoo / squidb

SquiDB is a SQLite database library for Android and iOS
https://github.com/yahoo/squidb/wiki
Apache License 2.0
1.31k stars 132 forks source link

More exception handling improvements #135

Closed sbosley closed 8 years ago

sbosley commented 8 years ago

This PR makes SquidDatabase more disciplined about the cleanup we do if runtime exceptions are encountered while opening a DB -- most importantly, we should null out the internal database instance to make sure there's no way we could accidentally be holding an invalid one in case the thrown exception is silently suppressed.

We also should stop wrapping runtime exceptions in other exceptions -- it makes things more unpredictable if you're trying to catch runtime problems and doesn't really have any benefit.

I'll add a few unit tests before we merge this.

jdkoren commented 8 years ago

LGTM