chore: include underlying error when logging failed exploit intelligence job reason [Backport release/0.6.z] - #2572
Merged
Conversation
(cherry picked from commit 88b1c1d)
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideBackport PR updates how exploit intelligence request errors are mapped into analysis errors so that underlying error details are preserved in logs and job failure reasons, and simplifies error handling in the SBOM upload path. Sequence diagram for updated upload_sbom error handlingsequenceDiagram
participant upload_sbom
participant classify_response_error
participant AnalysisError
upload_sbom->>classify_response_error: classify_response_error(label, request_send_await)
classify_response_error-->>upload_sbom: Ok(response) or Err(EiRequestError)
alt Err(EiRequestError)
upload_sbom->>AnalysisError: AnalysisError_from(EiRequestError)
AnalysisError-->>upload_sbom: Err(AnalysisError)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
From<EiRequestError> for AnalysisError, wrappingTransient(anyhow::Error)withanyhow::anyhow!("{detail}")discards the original error context; consider passing the existinganyhow::Errorthrough directly (e.g.,Self::Retryable(detail)) to preserve the error chain. - Replacing the
map_errblock inupload_sbomwithmap_err(AnalysisError::from)removes thetracing::warn!logging of EI upload failures; if those logs are still useful for operations, consider moving the logging intoAnalysisError::fromorclassify_response_errorrather than dropping it entirely.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `From<EiRequestError> for AnalysisError`, wrapping `Transient(anyhow::Error)` with `anyhow::anyhow!("{detail}")` discards the original error context; consider passing the existing `anyhow::Error` through directly (e.g., `Self::Retryable(detail)`) to preserve the error chain.
- Replacing the `map_err` block in `upload_sbom` with `map_err(AnalysisError::from)` removes the `tracing::warn!` logging of EI upload failures; if those logs are still useful for operations, consider moving the logging into `AnalysisError::from` or `classify_response_error` rather than dropping it entirely.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Strum355
approved these changes
Aug 12, 2026
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.
Description
Backport of #2568 to
release/0.6.z.Summary by Sourcery
Improve exploit intelligence runner error propagation to preserve underlying error details in analysis failures.
Bug Fixes:
Enhancements: