[Dashboard] Explorer to show transaction error message (#4437)

## Problem solved

Before:
<img width="747" alt="image" src="https://github.com/user-attachments/assets/ea60b693-70f9-4a20-8d31-246dc428e580">

After:
<img width="746" alt="image" src="https://github.com/user-attachments/assets/58fd622f-0aad-403f-976e-d06ac01ae0e2">

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the `formatError` function in `interactive-abi-function.tsx` to handle different error objects more effectively.

### Detailed summary
- Improved error handling in `formatError` function
- Added a check for `error.message` property
- Removed unnecessary type casting for `error` object

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
This commit is contained in:
kien-ngo
2024-09-06 07:01:06 +00:00
parent f6552e95dd
commit 9c0797b354
@@ -70,6 +70,9 @@ function formatResponseData(data: unknown): string {
}
function formatError(error: Error): string {
if ((error as Error).message) {
return (error as Error).message;
}
// biome-ignore lint/suspicious/noExplicitAny: FIXME
if ((error as any).reason) {
// biome-ignore lint/suspicious/noExplicitAny: FIXME