From afc77d0294d7404b0210b9b0bf7313f261466cd1 Mon Sep 17 00:00:00 2001 From: James Clarke Date: Wed, 19 Jul 2023 17:16:06 +0100 Subject: [PATCH] Extract and show error `details` attr in repl and editor (Fixes #205) --- shared/studio/tabs/queryEditor/index.tsx | 5 +++++ shared/studio/tabs/repl/index.tsx | 6 ++++++ shared/studio/tabs/repl/repl.module.scss | 4 ++++ shared/studio/utils/extractErrorDetails.ts | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/shared/studio/tabs/queryEditor/index.tsx b/shared/studio/tabs/queryEditor/index.tsx index d79181f4..6f70c1ab 100644 --- a/shared/studio/tabs/queryEditor/index.tsx +++ b/shared/studio/tabs/queryEditor/index.tsx @@ -318,6 +318,11 @@ const QueryResult = observer(function QueryResult() {
{result.error.data.name}:{" "} {result.error.data.msg} + {result.error.data.details ? ( +
+ Details: {result.error.data.details} +
+ ) : null} {result.error.data.hint ? (
Hint: {result.error.data.hint} diff --git a/shared/studio/tabs/repl/index.tsx b/shared/studio/tabs/repl/index.tsx index 4e54a8d9..3fb52d13 100644 --- a/shared/studio/tabs/repl/index.tsx +++ b/shared/studio/tabs/repl/index.tsx @@ -415,6 +415,11 @@ const ReplHistoryItem = observer(function ReplHistoryItem({
{item.error.data.name}:{" "} {item.error.data.msg} + {item.error.data.details ? ( +
+ Details: {item.error.data.details} +
+ ) : null} {item.error.data.hint ? (
Hint: {item.error.data.hint}
) : null} @@ -561,6 +566,7 @@ const ReplHistoryItem = observer(function ReplHistoryItem({ >