Skip to content

Conversation

@broody
Copy link
Contributor

@broody broody commented Nov 3, 2025

Summary

Enhanced error display with full error details

  • Previously, unexpected errors only showed minimal information like {"__wbg_ptr":2987000}
  • Now captures and displays all enumerable properties from error objects
  • Particularly helpful for WASM/Rust errors that have additional fields beyond standard Error properties
  • Added serializeErrorDetails() utility function
  • Errors are now expandable by default with copy functionality

Changes

  • Add serializeErrorDetails() function to capture all error object properties
  • Update StarknetUnexpectedError case to show full error details
  • Update unknown error fallbacks to display and allow copying full error details
  • Fix claim total calculation to use actual claim amounts instead of array length

Testing

Error displays now show complete information for debugging, including all WASM/Rust error fields.


Note

Enhances ErrorAlert to serialize and show full error details (with copy and default expansion) across unknown and Starknet errors.

  • Error handling improvements
    • ErrorAlert.tsx:
      • Add serializeErrorDetails(error) to capture enumerable fields, handle circular refs/BigInt, and include standard Error props.
      • Use serialized details for unknown errors and StarknetUnexpectedError; set isExpanded by default and enable copyText.
      • Update fallbacks (RPC/GraphQL/unknown) to prefer serializeErrorDetails when message is absent and provide copy support.

Written by Cursor Bugbot for commit 06ec27e. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Nov 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
controller-example-next Ready Ready Preview Nov 3, 2025 7:01pm
controller-example-next-compat Ready Ready Preview Nov 3, 2025 7:01pm
keychain Error Error Nov 3, 2025 7:01pm
keychain-storybook Error Error Nov 3, 2025 7:01pm

- Add serializeErrorDetails() function to capture all enumerable properties
- Handle WASM/Rust errors with non-standard fields like __wbg_ptr
- Update StarknetUnexpectedError to show full error details
- Make unknown errors expandable with copy functionality
- Format error details as readable JSON with proper indentation
- Use unknown instead of any for better type safety
- Add type guard to check if error is an object
- Add proper type assertions for safe property access
cursor[bot]

This comment was marked as outdated.

- Add WeakSet-based circular reference detection
- Replace circular references with '[Circular Reference]' marker
- Handle BigInt serialization by converting to string
- Add try-catch fallback for any remaining serialization failures
- Prevents JSON.stringify errors from breaking error display
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.

2 participants