Show meaningful error messages for failed capture triage#639
Show meaningful error messages for failed capture triage#639Chris0Jeky merged 4 commits intomainfrom
Conversation
Surface the backend ErrorMessage through the capture detail API response so the frontend can display meaningful failure information.
Matches the new backend field so the detail view can display error info.
…xView When a capture item has Failed status and an errorMessage, display an error banner in the detail panel with a user-friendly hint. The triage button now shows "Retry Triage" for failed items. Closes #615.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Self-reviewError message sanitizationVerified safe. The backend already runs Retry idempotencyVerified safe. Error banner visibilityThe banner only renders when DTO field ordering
No issues found requiring changes. |
There was a problem hiding this comment.
Code Review
This pull request introduces error reporting for failed triage items by adding an ErrorMessage property to the backend DTOs and the frontend CaptureItem interface. The UI now includes a 'Retry Triage' button and an error banner that displays when a capture fails. Feedback was provided to ensure the error banner remains visible even if a specific error message is missing, so that users always receive guidance on how to proceed when a triage fails.
| v-if="(selectedItem.status === 6 || selectedItem.status === 'Failed') && selectedItem.errorMessage" | ||
| class="td-inbox-detail__error-banner" | ||
| data-testid="capture-error-banner" | ||
| role="alert" | ||
| > | ||
| <p class="td-inbox-detail__error-title">Triage failed</p> | ||
| <p class="td-inbox-detail__error-message">{{ selectedItem.errorMessage }}</p> | ||
| <p class="td-inbox-detail__error-hint"> | ||
| You can edit the text and retry, or ignore this capture if it is no longer needed. | ||
| </p> | ||
| </div> |
There was a problem hiding this comment.
The error banner is currently hidden if selectedItem.errorMessage is null or empty, even if the status is Failed. This means users won't see the helpful hint about editing and retrying if the backend fails to provide a specific error message (e.g., due to a generic timeout or unhandled exception).
It is better to show the banner whenever the status is Failed, and only conditionally render the specific error message paragraph.
v-if="selectedItem.status === 6 || selectedItem.status === 'Failed'"
class="td-inbox-detail__error-banner"
data-testid="capture-error-banner"
role="alert"
>
<p class="td-inbox-detail__error-title">Triage failed</p>
<p v-if="selectedItem.errorMessage" class="td-inbox-detail__error-message">{{ selectedItem.errorMessage }}</p>
<p class="td-inbox-detail__error-hint">
You can edit the text and retry, or ignore this capture if it is no longer needed.
</p>
</div>
Adversarial Code Review -- PR #639Security[LOW] Raw error messages exposed to the frontend without length cap
However, there is no max-length enforcement in Recommendation: Consider adding a truncation guard in Correctness[OK] ErrorMessage field is properly nullable. The DTO parameter [OK] Status check handles both numeric and string values. The template condition [OK] DTO positional record parameter ordering. Adding UX[OK] No XSS risk. The error message is rendered via [MINOR] "Retry Triage" button label appears but the button handler is unchanged. The [MINOR] Error banner only shows when Contract / API Compatibility[LOW] Adding ErrorMessage to CaptureItemDto is additive and non-breaking. JSON serialization of a new nullable field defaults to either Test Gaps[MEDIUM] No unit tests for the error banner display. The PR adds a new UI element (
The [MEDIUM] No backend tests for ErrorMessage mapping. The Summary
The two MEDIUM items (missing tests) should be addressed before merge to satisfy the project's Definition of Done. |
…essage Address Gemini review: banner now shows on Failed status regardless of whether errorMessage is populated. The specific error message paragraph is conditionally rendered only when available.
Summary
errorMessagefield to backendCaptureItemDtoand map it fromLlmRequest.ErrorMessageso the API returns failure detailserrorMessageto the frontendCaptureItemtypeCloses #615
Test plan