diff options
author | Stuart Stock <stuart@int08h.com> | 2018-10-11 21:27:10 -0500 |
---|---|---|
committer | Stuart Stock <stuart@int08h.com> | 2018-10-11 21:27:10 -0500 |
commit | dda76cfc88d6673358c6dd21007c227c45ccb13f (patch) | |
tree | f0b62cb5a1db2c098d368831c2d8847ea1dffa77 /src/error.rs | |
parent | c66513b606f6aacf61bab1434c1f512c24981b2b (diff) | |
download | roughenough-dda76cfc88d6673358c6dd21007c227c45ccb13f.zip |
another wip checkpoint; server integration
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index b681f33..971bccd 100644 --- a/src/error.rs +++ b/src/error.rs @@ -15,6 +15,7 @@ use std; use tag::Tag; +use key::KmsError; /// Error types generated by this implementation #[derive(Debug)] @@ -58,3 +59,14 @@ impl From<std::io::Error> for Error { Error::EncodingFailure(err) } } + +impl From<KmsError> for Error { + fn from(err: KmsError) -> Self { + match err { + KmsError::OperationFailed(m) => Error::InvalidConfiguration(m), + KmsError::InvalidConfiguration(m) => Error::InvalidConfiguration(m), + KmsError::InvalidData(m) => Error::InvalidConfiguration(m), + KmsError::InvalidKey(m) => Error::InvalidConfiguration(m), + } + } +} |