Bug #2278
closed
Unintuitive error reporting by SecPublicInfo (SecPublicInfoSqlite3)
Added by Alex Afanasyev almost 10 years ago.
Updated almost 10 years ago.
Description
When the underlying database is corrupted (contains some old stuff), applications are likely to crash with unintuitive error
ERROR: (Block::get) Requested a non-existed type [7] from Block
We should try to catch tlv::Error exceptions when reading/decoding data from the database and throw a more reasonable error that will be easy to understand and debug for the user.
- Related to Bug #2274: ERROR: (Block::get) Requested a non-existed type [7] from Block added
We could define database version, which is incremented each time an incompatible change is made.
If the stored version differs from a constant in the library, the library shall either run upgrade procedure, or report that the database must be wiped because no upgrade is possible.
This probably be another useful thing, but separate from this issue. Even if the database is correct, the content of the database or some entries in the database may be corrupted. In this case, we still need to handle error and present a more meaningful error.
By the way, I guess "non-existed" should be "non-existent".
- Status changed from New to Code review
- % Done changed from 0 to 100
- Status changed from Code review to Closed
Fixed in commit:a90ba482597d899fe638993f257ec83e4eca4524
Also available in: Atom
PDF