mirror of
https://github.com/martinvonz/jj.git
synced 2024-11-28 17:41:14 +00:00
drop: downgrade two assertions to error messages
These assertions were there to catch bugs, but when the bugs happen, the assertions can obsure the underlying error (as @tp-woven found out on #258). Let's just print errors instead.
This commit is contained in:
parent
ca5a2391ab
commit
45c9d297c2
2 changed files with 4 additions and 10 deletions
|
@ -175,11 +175,8 @@ impl UnpublishedOperation {
|
|||
|
||||
impl Drop for UnpublishedOperation {
|
||||
fn drop(&mut self) {
|
||||
if !std::thread::panicking() {
|
||||
assert!(
|
||||
self.closed,
|
||||
"UnpublishedOperation was dropped without being closed."
|
||||
);
|
||||
if !self.closed && !std::thread::panicking() {
|
||||
eprintln!("BUG: UnpublishedOperation was dropped without being closed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1063,11 +1063,8 @@ impl LockedWorkingCopy<'_> {
|
|||
|
||||
impl Drop for LockedWorkingCopy<'_> {
|
||||
fn drop(&mut self) {
|
||||
if !std::thread::panicking() {
|
||||
assert!(
|
||||
self.closed,
|
||||
"Working copy lock was dropped without being closed."
|
||||
);
|
||||
if !self.closed && !std::thread::panicking() {
|
||||
eprintln!("BUG: Working copy lock was dropped without being closed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue