Skip to content

Improve error details with richer diagnostic information#1644

Merged
kmcginnes merged 3 commits intoaws:mainfrom
kmcginnes:improve-error-details
Apr 7, 2026
Merged

Improve error details with richer diagnostic information#1644
kmcginnes merged 3 commits intoaws:mainfrom
kmcginnes:improve-error-details

Conversation

@kmcginnes
Copy link
Copy Markdown
Collaborator

@kmcginnes kmcginnes commented Apr 7, 2026

Description

The Error Details dialog previously showed only the error name and message, which often duplicated the user-friendly display error without adding diagnostic value. This change makes the details dialog genuinely useful for troubleshooting by surfacing status codes, response data, cause chains, and structured validation errors.

  • Extract createErrorDetails from ErrorDetailsButton into a standalone tested function
  • Show HTTP status code and standard status text for NetworkError (e.g., "500 Internal Server Error")
  • Add statusText property to NetworkError backed by an HTTP_STATUS_TEXT lookup
  • Display response body data as formatted JSON in a code editor when available
  • Surface error.cause chains with all own properties (excluding stack traces)
  • Show ZodError issues as structured JSON in the data field
  • Extract extractErrorMessage to generically pull messages from error response bodies using detailedMessage, message, description, or error fields
  • Remove Neptune-specific NeptuneErrorSchema in favor of the generic extractErrorMessage approach
  • Add text-muted-foreground to Label for better visual distinction in the dialog

Validation

  • pnpm run checks passes (lint, format, types)
  • pnpm test passes (1483/1483 tests across 141 files)
  • 35 tests for createErrorDetails covering NetworkError, ZodError, DOMException, Error with cause chains, and non-Error values
  • 11 tests for extractErrorMessage covering all key priorities and edge cases
Screenshot of updated error details modal

Related Issues

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I have verified pnpm checks passes with no errors.
  • I have verified pnpm test passes with no failures.
  • I have covered new added functionality with unit tests if necessary.
  • I have updated documentation if necessary.

@kmcginnes kmcginnes marked this pull request as ready for review April 7, 2026 17:22
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 93.75000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.04%. Comparing base (c5affc5) to head (3820449).
⚠️ Report is 119 commits behind head on main.

Files with missing lines Patch % Lines
...aph-explorer/src/connector/fetchDatabaseRequest.ts 0.00% 1 Missing and 1 partial ⚠️
...kages/graph-explorer/src/components/PanelError.tsx 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1644       +/-   ##
===========================================
+ Coverage   47.81%   63.04%   +15.23%     
===========================================
  Files         382      396       +14     
  Lines        8525     9235      +710     
  Branches     3159     3514      +355     
===========================================
+ Hits         4076     5822     +1746     
+ Misses       3070     2368      -702     
+ Partials     1379     1045      -334     
Flag Coverage Δ
unittests 63.04% <93.75%> (+15.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kmcginnes kmcginnes merged commit 204f07c into aws:main Apr 7, 2026
4 checks passed
@kmcginnes kmcginnes deleted the improve-error-details branch April 7, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error details to show more useful diagnostic information

2 participants