From c9db2f7c9c15cf60817138a3dcccd70e541767d9 Mon Sep 17 00:00:00 2001 From: BlipRanger <1860540+BlipRanger@users.noreply.github.com> Date: Wed, 5 Jul 2023 23:33:32 -0400 Subject: [PATCH] More descriptive error handling. --- public/scripts/extensions/infinity-context/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/scripts/extensions/infinity-context/index.js b/public/scripts/extensions/infinity-context/index.js index 2cef52152..ecdf56830 100644 --- a/public/scripts/extensions/infinity-context/index.js +++ b/public/scripts/extensions/infinity-context/index.js @@ -318,7 +318,12 @@ async function onExportClick() { link.click(); document.body.removeChild(link); } else { - toastr.error('An error occurred while attempting to download the data'); + //Show the error from the result without the html, only what's in the body paragraph + let parser = new DOMParser(); + let error = await exportResult.text(); + let doc = parser.parseFromString(error, 'text/html'); + let errorMessage = doc.querySelector('p').textContent; + toastr.error(`An error occurred while attempting to download the data from ChromaDB: ${errorMessage}`); } }