Skip to content

Commit

Permalink
Fix error handling in sampler.rs (#645)
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

Also fix freebsd ci
  • Loading branch information
benfred committed Dec 16, 2023
1 parent 2f8cfdd commit 7cbbc01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ jobs:
run: lscpu
- name: Install VM tools
run: |
sudo apt-get update -qq
sudo apt-get install -qq -o=Dpkg::Use-Pty=0 moreutils
sudo chronic apt-get install -qq -o=Dpkg::Use-Pty=0 vagrant virtualbox qemu libvirt-daemon-system
- name: Set up VM
Expand Down
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 7cbbc01

Please sign in to comment.