Update db to panic when unexpected error happens. With that, we could update general DB interface to be
Get(key []byte): ([]byte, bool)
Set(key, value []byte)
Del(key []byte)
Motivation
If underlying DB fails with unexpected reason (ex: other than not found error), there is no way to recover or continue from that state automatically. Further more, if it proceed with the state, it could result in unexpected state.
Therefore, unrecoverable error should be panic and stop the process.
Description
Update
db
to panic when unexpected error happens. With that, we could update general DB interface to beMotivation
If underlying DB fails with unexpected reason (ex: other than not found error), there is no way to recover or continue from that state automatically. Further more, if it proceed with the state, it could result in unexpected state. Therefore, unrecoverable error should be panic and stop the process.