From ec4fc61ac6c3aab24d6e24b8d36dd6f22ac91829 Mon Sep 17 00:00:00 2001 From: Pauline Ribeyre <4224001+paulineribeyre@users.noreply.github.com> Date: Wed, 3 Dec 2025 13:24:13 -0600 Subject: [PATCH 1/2] Print the errors instead of '[object Object]' --- doc/queries.md | 2 +- src/components/Utils/queries.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/queries.md b/doc/queries.md index 140f2596..87e2c5cb 100644 --- a/doc/queries.md +++ b/doc/queries.md @@ -807,7 +807,7 @@ Result: See [Elasticsearch documentation on Cardinality](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html) > **Note** -> curenntly does not support nested feilds +> currently does not support nested fields Example: diff --git a/src/components/Utils/queries.js b/src/components/Utils/queries.js index 7c9c9b4b..390898f5 100644 --- a/src/components/Utils/queries.js +++ b/src/components/Utils/queries.js @@ -412,12 +412,13 @@ export const askGuppyForTotalCounts = ( }).then((response) => response.json()) .then((response) => { if (response.errors) { - throw new Error(`Error during download ${response.errors}`); + err_msgs = response.errors.map(e => e.message).join('; ') + throw new Error(`Error during download: ${err_msgs}`); } return response.data._aggregation[type]._totalCount; }) .catch((err) => { - throw new Error(`Error during download ${err}`); + throw new Error(`Error during download: ${err}`); }); }; From 29fe5842754b0dcc5b2ce96df4be563446a2f45e Mon Sep 17 00:00:00 2001 From: Pauline Ribeyre <4224001+paulineribeyre@users.noreply.github.com> Date: Wed, 3 Dec 2025 13:26:39 -0600 Subject: [PATCH 2/2] fix --- src/components/Utils/queries.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Utils/queries.js b/src/components/Utils/queries.js index 390898f5..5f996eb9 100644 --- a/src/components/Utils/queries.js +++ b/src/components/Utils/queries.js @@ -412,8 +412,8 @@ export const askGuppyForTotalCounts = ( }).then((response) => response.json()) .then((response) => { if (response.errors) { - err_msgs = response.errors.map(e => e.message).join('; ') - throw new Error(`Error during download: ${err_msgs}`); + let errMsgs = response.errors.map(e => e.message).join('; ') + throw new Error(`Error during download: ${errMsgs}`); } return response.data._aggregation[type]._totalCount; })