Display implementations should not expose Debug
output
#1933
Labels
good first issue
Good for newcomers
Debug
output
#1933
Currently, the
Display
implementation forLoadError
displaysDebug
output forLoadError::MissingDescriptor
andLoadError::Mismatch
:I think this is generally not a good practice.
Debug
output is automatically generated, and is not as nice to read as a hand-writtenDisplay
implementation's output.I noticed this in a test we were loading a wallet with the incorrect network, and instead of getting a nice error message, we got
data mismatch: Network { loaded: Network::Testnet, expected: Network::Bitcoin }
. Our project never exposesDebug
output to the user, and we'd like to avoid doing this if we use BDK, but still be able to expose BDK errors to the user viaDisplay
.The text was updated successfully, but these errors were encountered: