Skip to content

Commit

Permalink
fix(engine-dylib): display error log if we can't delete the tmp file
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
  • Loading branch information
bnjjj committed Sep 1, 2021
1 parent efc84e1 commit 8d8ee21
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/engine-dylib/src/artifact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use std::path::{Path, PathBuf};
use std::process::Command;
use std::sync::{Arc, Mutex};
use tempfile::NamedTempFile;
use tracing::log::error;
#[cfg(feature = "compiler")]
use tracing::trace;
use wasmer_compiler::{
Expand Down Expand Up @@ -62,7 +63,9 @@ pub struct DylibArtifact {
impl Drop for DylibArtifact {
fn drop(&mut self) {
if self.is_temporary {
std::fs::remove_file(&self.dylib_path).expect("cannot delete the temporary artifact");
if let Err(err) = std::fs::remove_file(&self.dylib_path) {
error!("cannot delete the temporary dylib artifact: {}", err);
}
}
}
}
Expand Down

0 comments on commit 8d8ee21

Please sign in to comment.