Skip to content

Commit

Permalink
Server: Avoid using map_err in order to preserve #[track_caller] (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
svix-aaron1011 authored Sep 19, 2023
1 parent a5f5df6 commit 1354ac1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/svix-server/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ pub trait Traceable<T> {

impl<T> Traceable<T> for Result<T> {
fn trace(self) -> Result<T> {
self.map_err(|e| e.trace())
// Using `map_err` would lose `#[track_caller]` information
match self {
Err(e) => Err(e.trace()),
ok => ok,
}
}
}

Expand Down

0 comments on commit 1354ac1

Please sign in to comment.