Skip to content

Commit 9d1553d

Browse files
committed
Finish anyhow error changes
1 parent d052e77 commit 9d1553d

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

crates/devolutions-pedm/src/api/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ impl core::error::Error for ServeError {
227227
Self::TokioIo(e) => Some(e),
228228
Self::AppState(e) => Some(e),
229229
Self::Db(e) => Some(e),
230-
Self::Anyhow(e) => Some(e),
230+
Self::Other(e) => Some(e.as_ref()),
231231
}
232232
}
233233
}
@@ -238,7 +238,7 @@ impl fmt::Display for ServeError {
238238
Self::TokioIo(e) => e.fmt(f),
239239
Self::AppState(e) => e.fmt(f),
240240
Self::Db(e) => e.fmt(f),
241-
Self::Anyhow(s) => e.fmt(f),
241+
Self::Other(e) => e.fmt(f),
242242
}
243243
}
244244
}
@@ -260,7 +260,7 @@ impl From<DbError> for ServeError {
260260
}
261261
impl From<anyhow::Error> for ServeError {
262262
fn from(e: anyhow::Error) -> Self {
263-
Self::Anyhow(e.to_string())
263+
Self::Other(e)
264264
}
265265
}
266266

crates/devolutions-pedm/src/policy.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ impl core::error::Error for LoadPolicyError {
356356
match self {
357357
Self::Io(e, _) => Some(e),
358358
Self::Json(e) => Some(e),
359-
Self::Other(e) => Some(e),
359+
Self::Other(e) => Some(e.as_ref()),
360360
}
361361
}
362362
}
@@ -366,7 +366,7 @@ impl fmt::Display for LoadPolicyError {
366366
match self {
367367
Self::Io(e, path) => write!(f, "IO error while loading policy at {path}: {e}"),
368368
Self::Json(e) => e.fmt(f),
369-
Self::Other(s) => e.fmt(f),
369+
Self::Other(e) => e.fmt(f),
370370
}
371371
}
372372
}
@@ -378,7 +378,7 @@ impl From<serde_json::Error> for LoadPolicyError {
378378
}
379379
impl From<anyhow::Error> for LoadPolicyError {
380380
fn from(e: anyhow::Error) -> Self {
381-
Self::Other(e.to_string())
381+
Self::Other(e)
382382
}
383383
}
384384

0 commit comments

Comments
 (0)