Bug #2278
closedUnintuitive error reporting by SecPublicInfo (SecPublicInfoSqlite3)
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.
Updated by Alex Afanasyev almost 10 years ago
- Related to Bug #2274: ERROR: (Block::get) Requested a non-existed type [7] from Block added
Updated by Junxiao Shi almost 10 years ago
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.
Updated by Alex Afanasyev almost 10 years ago
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.
Updated by Davide Pesavento almost 10 years ago
By the way, I guess "non-existed" should be "non-existent".
Updated by Yingdi Yu almost 10 years ago
- Status changed from New to Code review
- % Done changed from 0 to 100
Updated by Alex Afanasyev almost 10 years ago
- Status changed from Code review to Closed
Fixed in commit:a90ba482597d899fe638993f257ec83e4eca4524