Fixed base64 error

This commit is contained in:
Igor Katson 2023-12-03 09:49:10 +00:00
parent 63a21a50fd
commit ca66a70bc1
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
3 changed files with 6 additions and 5 deletions

View file

@ -11,10 +11,10 @@ pub struct ApiError {
}
impl ApiError {
pub fn new_from_string(status: StatusCode, text: String) -> Self {
pub fn new_from_anyhow(status: StatusCode, error: anyhow::Error) -> Self {
Self {
status: Some(status),
kind: ApiErrorKind::Other(anyhow::anyhow!("{}", text)),
kind: ApiErrorKind::Other(error),
plaintext: false,
}
}