Skip to content

Commit ad47450

Browse files
committed
Track caller locations for arrow and sqlite ops
1 parent afcaacf commit ad47450

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

qry-runtime/src/stdlib/data/sqlite.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use rusqlite::types::ValueRef;
1212
use rusqlite::{Connection as SqliteConnection, Result as SqliteResult, NO_PARAMS};
1313
use std::cell::RefCell;
1414
use std::collections::HashMap;
15+
use std::panic::Location;
1516
use std::rc::Rc;
1617
use std::sync::Arc;
1718

@@ -35,17 +36,19 @@ lazy_static! {
3536
};
3637
}
3738

39+
#[track_caller]
3840
pub fn arrow_op<T>(ctx: &EvalContext, res: ArrowResult<T>) -> EvalResult<T> {
3941
match res {
4042
Ok(val) => Ok(val),
41-
Err(err) => Err(ctx.exception(&SourceLocation::Unknown, format!("arrow error: {}", err))),
43+
Err(err) => Err(ctx.exception(&Location::caller().into(), format!("arrow error: {}", err))),
4244
}
4345
}
4446

47+
#[track_caller]
4548
pub fn sqlite_op<T>(ctx: &EvalContext, res: SqliteResult<T>) -> EvalResult<T> {
4649
match res {
4750
Ok(val) => Ok(val),
48-
Err(err) => Err(ctx.exception(&SourceLocation::Unknown, format!("sqlite error: {}", err))),
51+
Err(err) => Err(ctx.exception(&Location::caller().into(), format!("sqlite error: {}", err))),
4952
}
5053
}
5154

0 commit comments

Comments
 (0)