Skip to content

Commit

Permalink
Truncation error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rroelke committed Mar 19, 2024
1 parent 0027359 commit 907a760
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/array/domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,15 @@ impl<'ctx> Domain<'ctx> {
let c_context = self.context.as_mut_ptr();
let c_domain = *self.raw;
let mut c_dimension: *mut ffi::tiledb_dimension_t = out_ptr!();
let c_idx = idx.try_into().unwrap();
let c_idx = match idx.try_into() {
Ok(idx) => idx,
Err(e) => {
return Err(crate::error::Error::from(format!(
"Invalid dimension: {}",
e
)))
}
};
let c_ret = unsafe {
ffi::tiledb_domain_get_dimension_from_index(
c_context,
Expand Down

0 comments on commit 907a760

Please sign in to comment.