tekartik / sembast.dart

Simple io database
BSD 2-Clause "Simplified" License
780 stars 64 forks source link

Exception bubbling #324

Closed Hyla96 closed 1 year ago

Hyla96 commented 2 years ago

This pull request is strictly connected to this one: https://github.com/tekartik/sembast_sqflite/pull/12

Description

We noticed an issue with the exception bubbling when PointyCastle fails to decrypt the DB because of a corrupted password.

What happens with the current implementation is that the exception is not properly bubbled to the calling function and it has to be caught on a much higher level.

This pull request allows to bubble the exception to who calls jdbFullImport() and on, allowing a graceful handling of the exception

alextekartik commented 2 years ago

Thanks. Do you have any test that can validate what it does and fix? (such as a fake codec that throws en exception). I think this can be reproduced during open, correct?

Hyla96 commented 2 years ago

Thanks. Do you have any test that can validate what it does and fix? (such as a fake codec that throws en exception). I think this can be reproduced during open, correct?

I don't yet, but I'll add it to the pull request by next week

alextekartik commented 1 year ago

I added more test on codec (and supporting async codec) in the latest 3.4.2 that you might want to try.