diff options
author | HampusM <hampus@hampusmat.com> | 2023-03-26 13:04:28 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-03-26 13:04:28 +0200 |
commit | c8e5944d697b33738c7ba01694dde5e360470043 (patch) | |
tree | c7ba2ec7b2c381adfae2a42c2ced46ba0fbd07a4 /src/lib.rs | |
parent | add06dafdf874b1b419e5eef918c6b1131ab09fd (diff) |
refactor: add deserializer error wrapper
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -153,5 +153,18 @@ pub enum RegistryError /// Deserialization failed. #[error("Deserialization failed")] - DeserializationFailed(#[from] DeserializerError), + DeserializationFailed(#[from] DeserializationError), } + +impl From<DeserializerError> for RegistryError +{ + fn from(err: DeserializerError) -> Self + { + DeserializationError(err).into() + } +} + +/// Deserialization error. +#[derive(Debug, thiserror::Error)] +#[error(transparent)] +pub struct DeserializationError(#[from] DeserializerError); |