diff options
author | Daniel Mueller <deso@posteo.net> | 2019-01-09 11:16:03 -0800 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2019-01-09 11:16:03 -0800 |
commit | 3a99e7417e4c4eb30df9e711077c89b75764c029 (patch) | |
tree | bd56330e4809a9a1a7ed677c26a1b4805b31d30d /rand/rand_jitter | |
parent | 6e0efd98e9ee07a01241e2187b4c820770c3c478 (diff) | |
download | nitrocli-3a99e7417e4c4eb30df9e711077c89b75764c029.tar.gz nitrocli-3a99e7417e4c4eb30df9e711077c89b75764c029.tar.bz2 |
Report command errors properly
So far we have taken all nitrokey::CommandError objects and put them in
formatted form into the Error::Error variant. What we really should do,
though, is to preserve the original error, with the additional context
provided by the caller, and report that up the stack directly. Doing so
has at least the benefit that we are able to check for expected errors
without hard coding the textual representation as maintained by the
nitrokey create.
This change refactors the code accordingly and adds two tests for such
expected error codes.
Diffstat (limited to 'rand/rand_jitter')
0 files changed, 0 insertions, 0 deletions