ffldb: Add dbErr to error description.#2876
Conversation
rstaudt2
left a comment
There was a problem hiding this comment.
Looks like a good improvement to me. The underlying error is being stored in the RawErr field of the converted error, but that field is never displayed in the error output.
Regarding displaying the key as hex, we did have a brief discussion of it in this PR for a similar error case.
If you are updating this location, it probably makes sense to update the case below for deletions as well. Or, another option could be to update the convertErr function to include the error to handle it for all cases.
d9c6aae to
ecbce5e
Compare
|
Now returning more info for all errors. Unsure how to trigger others besides low disc space, but that one looks the same. |
The update looks good to me. Just a couple of minor comments:
|
Add the reason for bad inserts, updates, and deletes to the error description and display key as hex in order to give the user more information when the database errors. This is especially useful for upgrades which may fail for several reasons, such as low disc space, which the user will now be informed about.
ecbce5e to
2e1ab78
Compare
|
doh! I shoulda run tests. I realized this caused some of the errors to print twice, as it was using the error's |
Add the reason for bad inserts, updates, and deletes to the error description.
2e1ab78 to
f9b8001
Compare
rstaudt2
left a comment
There was a problem hiding this comment.
Tested both locations by updating the leveldb code to force an error to be returned, and it worked as expected.
davecgh
left a comment
There was a problem hiding this comment.
The code changes look good and I also tested various failures by intentionally inducing them. Showing the underlying error is nice as it can often make it more obvious why something failed in cases such as out of disk space errors.
I am sorry for not making an issue first. I believe displaying the key as hex was lightly discussed in matrix and the consensus was that it's ok.
Error for low disc space on master:
With this diff:
Tested with a real upgrade.