Add shared lib

This commit is contained in:
Andras Schmelczer 2024-12-08 14:23:38 +00:00
parent 7d04f3c85c
commit 006d9d9160
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
3 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,24 @@
use base64::DecodeError;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum SyncLibError {
#[error("Base64 decoding error: {}", .reason)]
DecodingError { reason: String },
}
impl From<DecodeError> for SyncLibError {
fn from(e: DecodeError) -> Self {
SyncLibError::DecodingError {
reason: e.to_string(),
}
}
}
impl From<std::string::FromUtf8Error> for SyncLibError {
fn from(e: std::string::FromUtf8Error) -> Self {
SyncLibError::DecodingError {
reason: e.to_string(),
}
}
}