diff --git a/go/handle.go b/go/handle.go index 33e966b..53001c8 100644 --- a/go/handle.go +++ b/go/handle.go @@ -19,6 +19,10 @@ type Limits = possumC.Limits func Open(dir string) (handle *Handle, err error) { cHandle := possumC.NewHandle(dir) + if cHandle == nil { + err = errors.New("unhandled possum error") + return + } generics.InitNew(&handle) handle.cHandle.Init(cHandle, func(cHandle *possumC.Handle) { possumC.DropHandle(cHandle) diff --git a/src/c_api/ext_fns/mod.rs b/src/c_api/ext_fns/mod.rs index 2ba2bae..a8abcb6 100644 --- a/src/c_api/ext_fns/mod.rs +++ b/src/c_api/ext_fns/mod.rs @@ -29,7 +29,7 @@ pub extern "C" fn possum_new(path: *const c_char) -> *mut PossumHandle { let handle = match Handle::new(path_buf.clone()) { Ok(handle) => handle, Err(err) => { - error!("error creating possum handle in {path_buf:?}: {err}"); + error!("error creating possum handle in {path_buf:?}: {err:#?}"); return null_mut(); } }; diff --git a/src/dir.rs b/src/dir.rs index 9909345..03c694e 100644 --- a/src/dir.rs +++ b/src/dir.rs @@ -37,8 +37,14 @@ impl Dir { let _ = std::fs::remove_file(&dst_path); match clone_res { Ok(()) => true, - Err(err) if CloneFileError::is_unsupported(&err) => false, - Err(err) => return Err(err).context("testing clonefile"), + Err(err) if CloneFileError::is_unsupported(&err) => { + warn!(?err, "clonefile unsupported"); + false + }, + Err(err) => { + error!(?err); + return Err(err).context("testing clonefile") + }, } } }; diff --git a/src/handle.rs b/src/handle.rs index ca42d4b..6a804cf 100644 --- a/src/handle.rs +++ b/src/handle.rs @@ -103,7 +103,7 @@ impl Handle { "3.42" ); } - let dir = Dir::new(dir)?; + let dir = Dir::new(dir).context("new Dir")?; let mut conn = Connection::open(dir.path().join(MANIFEST_DB_FILE_NAME))?; Self::init_sqlite_conn(&mut conn, &dir)?; let (deleted_values, receiver) = sync::mpsc::sync_channel(10); diff --git a/src/sys/clonefile/sys.rs b/src/sys/clonefile/sys.rs index 3a8bf37..6cb3a6a 100644 --- a/src/sys/clonefile/sys.rs +++ b/src/sys/clonefile/sys.rs @@ -27,7 +27,7 @@ impl CloneFileError for NativeIoError { #[cfg(unix)] fn is_unsupported(&self) -> bool { self.raw_os_error() - .map(|errno| matches!(errno, EOPNOTSUPP)) + .map(|errno| matches!(errno, EOPNOTSUPP | libc::EXDEV)) .unwrap_or_default() } #[cfg(windows)]