-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add backtrace to error messages #7434
Conversation
@alamb do you know the reason why some test tasks running with |
If you mean this: https://github.com/search?q=repo%3Aapache%2Farrow-datafusion%20RUST_BACKTRACE&type=code I don't know of any reasons for the discrepancy |
Changing some tests checking exact error message to |
Adding |
I will add documentation and examples in follow up PR |
I have been away on vacation but am back now and will catch up with reviews over the next few days. This one looks great @comphead -- thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks great @comphead -- thank you very much. Does anyone else have any comments about this PR?
@@ -444,7 +467,7 @@ macro_rules! make_error { | |||
#[macro_export] | |||
macro_rules! $NAME { | |||
($d($d args:expr),*) => { | |||
Err(DataFusionError::$ERR(format!($d($d args),*).into())) | |||
Err(DataFusionError::$ERR(format!("{}{}", format!($d($d args),*), DataFusionError::get_back_trace()).into())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is pretty clever, to use the macro like this
Which issue does this PR close?
Part of #7360 .
Rationale for this change
Currently the user getting only error description which sometimes makes investigation more complex, adding optional back trace
What changes are included in this PR?
Adding the optional back trace for the errors being thrown.
By default the backtrace is disabled, to enable it uses Rust mechanism described https://doc.rust-lang.org/std/backtrace/index.html#environment-variables
Added
.strip_backtrace()
method to Datafusion Errors to get the error message only if the backtrace enabledUser Example
with backtrace enabled
Are these changes tested?
Yes, existing tests
Are there any user-facing changes?