fix TimeoutError and InvalidArgumentError getting raised as BamlError#2954
Merged
fix TimeoutError and InvalidArgumentError getting raised as BamlError#2954
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| } => anyhow::anyhow!(format!( | ||
| "Invalid parameters for BAML function {function_name}: {error}" | ||
| } => error.context(format!( | ||
| "Invalid parameters for BAML function {function_name}" |
There was a problem hiding this comment.
Error details lost when converting to string for tracing
Medium Severity
The change from anyhow::anyhow!(format!("...: {error}")) to error.context(...) alters how the error is displayed when converted to a string. In anyhow, Display for an error with context only shows the outermost message, not the full chain. Since the consuming code at lib.rs:1415 uses anyhow::anyhow!("{}", err_anyhow) to set errors for tracing, the original underlying error message is now lost in traces. Previously, the formatted string included both the context and the original error; now only the context appears in trace logs, making debugging harder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Improves error fidelity and context for runtime failures.
TimeoutErrorwhenLLMResponseis anLLMFailurewithErrorCode::Timeoutinstead of converting toValidationError(types/response.rs)anyhow::Contextto attach messages to underlying errors forFunctionNotFoundandInvalidParamsinprepare_function, keeping original cause chains (prepare_function.rs)pytest.skipstrings, and capturing/printing exception info intest_parameter_failing_assert(test_functions.py)Written by Cursor Bugbot for commit d9ee4ca. This will update automatically on new commits. Configure here.