ripple / explorer

Open Source XRP Ledger Explorer
https://livenet.xrpl.org/
MIT License
97 stars 62 forks source link

fix: add better error handling for transactions' Simple pages #939

Closed mvadari closed 4 months ago

mvadari commented 5 months ago

High Level Overview of Change

This PR has better error handling if there is a bug in a transaction's Simple page. This results in better user experience when something is broken.

This does add a package, react-error-boundary, but the package is very tiny and is quite useful.

Context of Change

I encountered this while using the Explorer.

Type of Change

TypeScript/Hooks Update

N/A

Before / After

Before: a black screen

After: image

Test Plan

pdp2121 commented 5 months ago

@bugsbunnies Should the message be something similar to the <NoMatch /> component for cohesiveness?

Screenshot 2024-02-15 at 3 59 16 PM

mvadari commented 5 months ago

@bugsbunnies Should the message be something similar to the <NoMatch /> component for cohesiveness?

I copied the old error message/CSS that was displayed in the Simple page when it wasn't supported for an unknown transaction, before we added support for a default Simple page.

pdp2121 commented 5 months ago

@bugsbunnies Should the message be something similar to the <NoMatch /> component for cohesiveness?

I copied the old error message/CSS that was displayed in the Simple page when it wasn't supported for an unknown transaction, before we added support for a default Simple page.

Make sense!

bugsbunnies commented 5 months ago

@bugsbunnies Should the message be something similar to the <NoMatch /> component for cohesiveness?

Screenshot 2024-02-15 at 3 59 16 PM

Yeah that makes sense

mvadari commented 5 months ago

@bugsbunnies Should the message be something similar to the <NoMatch /> component for cohesiveness?

Yeah that makes sense

IMO the current error message is better, because this would exclusively be due to an Explorer error, rather than user error. But I'm happy to edit the CSS if you'd prefer that.

mvadari commented 4 months ago

image