Skip to content

Commit c518b78

Browse files
fix: memory pool error type (#1346)
1 parent 497e40b commit c518b78

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

native/core/src/execution/memory_pool.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use std::{
2626
use jni::objects::GlobalRef;
2727

2828
use datafusion::{
29-
common::DataFusionError,
29+
common::{resources_datafusion_err, DataFusionError},
3030
execution::memory_pool::{MemoryPool, MemoryReservation},
3131
};
3232

@@ -101,12 +101,12 @@ impl MemoryPool for CometMemoryPool {
101101
// Release the acquired bytes before throwing error
102102
self.release(acquired as usize)?;
103103

104-
return Err(DataFusionError::Execution(format!(
104+
return Err(resources_datafusion_err!(
105105
"Failed to acquire {} bytes, only got {}. Reserved: {}",
106106
additional,
107107
acquired,
108-
self.reserved(),
109-
)));
108+
self.reserved()
109+
));
110110
}
111111
self.used.fetch_add(additional, Relaxed);
112112
}

0 commit comments

Comments
 (0)