Skip to content

Commit

Permalink
Fix error handling in sampler.rs
Browse files Browse the repository at this point in the history
We were calling unwrap_err when failing to create a PythonSpy
object in sampler.rs (on the result of sending the error on
a channel), when we should have been calling unwrap. Fix.

See #644
  • Loading branch information
benfred committed Dec 16, 2023
1 parent 2f8cfdd commit 3ad8fc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sampler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl Sampler {
spy
}
Err(e) => {
initialized_tx.send(Err(e)).unwrap_err();
initialized_tx.send(Err(e)).unwrap();
return;
}
};
Expand Down Expand Up @@ -308,7 +308,7 @@ impl PythonSpyThread {
}
Err(e) => {
warn!("Failed to profile python from process {}: {}", pid, e);
initialized_tx.send(Err(e)).unwrap_err();
initialized_tx.send(Err(e)).unwrap();
return;
}
};
Expand Down

0 comments on commit 3ad8fc3

Please sign in to comment.