Skip to content

Commit 0ffd5a4

Browse files
committed
capture backtraces
1 parent be43268 commit 0ffd5a4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

datafusion/common/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ macro_rules! downcast_value {
116116
// Not public API.
117117
#[doc(hidden)]
118118
pub mod __private {
119-
use super::DataFusionError;
120-
use super::Result;
119+
use crate::error::_internal_datafusion_err;
120+
use crate::Result;
121121
use arrow::array::Array;
122122
use std::any::{type_name, Any};
123123

@@ -129,11 +129,11 @@ pub mod __private {
129129
impl<T: Array + ?Sized> DowncastArrayHelper for T {
130130
fn downcast_array_helper<U: Any>(&self) -> Result<&U> {
131131
self.as_any().downcast_ref().ok_or_else(|| {
132-
DataFusionError::Internal(format!(
132+
_internal_datafusion_err!(
133133
"could not cast array of type {} to {}",
134134
self.data_type(),
135135
type_name::<U>()
136-
))
136+
)
137137
})
138138
}
139139
}
@@ -167,7 +167,7 @@ mod tests {
167167
.unwrap();
168168

169169
assert_eq!(
170-
error.to_string(),
170+
error.strip_backtrace(),
171171
"Internal error: could not cast array of type Int32 to arrow_array::array::primitive_array::PrimitiveArray<arrow_array::types::UInt64Type>.\n\
172172
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker"
173173
);

0 commit comments

Comments
 (0)