Skip to content

Commit

Permalink
wallet: print error on unsuccessful saving on Drop if no log feature
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Sep 3, 2024
1 parent 617daad commit 95a3a37
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,9 @@ impl<K, D: Descriptor<K>, L2: Layer2Descriptor> Drop for WalletDescr<K, D, L2> {
if self.is_autosave() {
if let Err(e) = self.store() {

Check warning on line 175 in src/wallet.rs

View check run for this annotation

Codecov / codecov/patch

src/wallet.rs#L173-L175

Added lines #L173 - L175 were not covered by tests
#[cfg(feature = "log")]
log::error!(
"impossible to automatically-save wallet descriptor during the Drop \
operation: {e}"
);
log::error!("impossible to automatically-save wallet descriptor on Drop: {e}");

Check warning on line 177 in src/wallet.rs

View check run for this annotation

Codecov / codecov/patch

src/wallet.rs#L177

Added line #L177 was not covered by tests
#[cfg(not(feature = "log"))]
eprintln!("impossible to automatically-save wallet descriptor on Drop: {e}")
}
}
}

Check warning on line 182 in src/wallet.rs

View check run for this annotation

Codecov / codecov/patch

src/wallet.rs#L180-L182

Added lines #L180 - L182 were not covered by tests
Expand Down Expand Up @@ -238,9 +237,9 @@ impl<L2: Layer2Data> Drop for WalletData<L2> {
if self.is_autosave() {
if let Err(e) = self.store() {

Check warning on line 238 in src/wallet.rs

View check run for this annotation

Codecov / codecov/patch

src/wallet.rs#L236-L238

Added lines #L236 - L238 were not covered by tests
#[cfg(feature = "log")]
log::error!(
"impossible to automatically-save wallet data during the Drop operation: {e}"
);
log::error!("impossible to automatically-save wallet data on Drop: {e}");

Check warning on line 240 in src/wallet.rs

View check run for this annotation

Codecov / codecov/patch

src/wallet.rs#L240

Added line #L240 was not covered by tests
#[cfg(not(feature = "log"))]
eprintln!("impossible to automatically-save wallet data on Drop: {e}")
}
}
}

Check warning on line 245 in src/wallet.rs

View check run for this annotation

Codecov / codecov/patch

src/wallet.rs#L243-L245

Added lines #L243 - L245 were not covered by tests
Expand Down Expand Up @@ -372,9 +371,9 @@ impl<L2: Layer2Cache> Drop for WalletCache<L2> {
if self.is_autosave() {
if let Err(e) = self.store() {

Check warning on line 372 in src/wallet.rs

View check run for this annotation

Codecov / codecov/patch

src/wallet.rs#L370-L372

Added lines #L370 - L372 were not covered by tests
#[cfg(feature = "log")]
log::error!(
"impossible to automatically-save wallet cache during the Drop operation: {e}"
);
log::error!("impossible to automatically-save wallet cache on Drop: {e}");

Check warning on line 374 in src/wallet.rs

View check run for this annotation

Codecov / codecov/patch

src/wallet.rs#L374

Added line #L374 was not covered by tests
#[cfg(not(feature = "log"))]
eprintln!("impossible to automatically-save wallet cache on Drop: {e}")
}
}
}

Check warning on line 379 in src/wallet.rs

View check run for this annotation

Codecov / codecov/patch

src/wallet.rs#L377-L379

Added lines #L377 - L379 were not covered by tests
Expand Down

0 comments on commit 95a3a37

Please sign in to comment.