From 4b86c04dc703faf3bf12f6143781b5940b62cb17 Mon Sep 17 00:00:00 2001 From: Karolis Ramanauskas Date: Tue, 3 Sep 2024 23:08:33 +0300 Subject: [PATCH] feat(explorer): show error message in error page (#3121) --- .changeset/lazy-ties-double.md | 5 +++++ packages/explorer/src/app/(explorer)/error.tsx | 8 +++++++- .../[worldAddress]/explorer/DataExplorer.tsx | 16 ++++++++++++++-- .../explorer/src/app/api/utils/getDatabase.ts | 6 ++++-- 4 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 .changeset/lazy-ties-double.md diff --git a/.changeset/lazy-ties-double.md b/.changeset/lazy-ties-double.md new file mode 100644 index 0000000000..56c7381bbe --- /dev/null +++ b/.changeset/lazy-ties-double.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/explorer": patch +--- + +Added error messages to error page to facilitate easier troubleshooting. diff --git a/packages/explorer/src/app/(explorer)/error.tsx b/packages/explorer/src/app/(explorer)/error.tsx index 08c77d587a..2c1604616b 100644 --- a/packages/explorer/src/app/(explorer)/error.tsx +++ b/packages/explorer/src/app/(explorer)/error.tsx @@ -10,13 +10,19 @@ type Props = { reset: () => void; }; -export default function Error({ reset }: Props) { +export default function Error({ reset, error }: Props) { const getUrl = useWorldUrl(); return (

400

Something went wrong :(

+ {error.message && ( +
+          {error.message}
+        
+ )} +