From 06015fbdaf9aa5509a4239f9baddd2f3f2203a3e Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 30 Sep 2021 03:52:18 -0400 Subject: [PATCH] Explore: Fix displaying rich history saving error message (#39766) (#39826) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Explore: Fix displaying rich history saving error message * Keep generic error message * remove testing snippet (cherry picked from commit f8ebcaa0d952a8c35598ac7549d4017baa537362) Co-authored-by: Piotr Jamróz --- public/app/core/utils/richHistory.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/app/core/utils/richHistory.ts b/public/app/core/utils/richHistory.ts index 67e1d85c477..fd3a60a33b3 100644 --- a/public/app/core/utils/richHistory.ts +++ b/public/app/core/utils/richHistory.ts @@ -78,7 +78,7 @@ export function addToRichHistory( store.setObject(RICH_HISTORY_KEY, updatedHistory); return updatedHistory; } catch (error) { - dispatch(notifyApp(createErrorNotification(error))); + dispatch(notifyApp(createErrorNotification('Saving rich history failed', error.message))); return richHistory; } } @@ -111,7 +111,7 @@ export function updateStarredInRichHistory(richHistory: RichHistoryQuery[], ts: store.setObject(RICH_HISTORY_KEY, updatedHistory); return updatedHistory; } catch (error) { - dispatch(notifyApp(createErrorNotification(error))); + dispatch(notifyApp(createErrorNotification('Saving rich history failed', error.message))); return richHistory; } } @@ -133,7 +133,7 @@ export function updateCommentInRichHistory( store.setObject(RICH_HISTORY_KEY, updatedHistory); return updatedHistory; } catch (error) { - dispatch(notifyApp(createErrorNotification(error))); + dispatch(notifyApp(createErrorNotification('Saving rich history failed', error.message))); return richHistory; } } @@ -144,7 +144,7 @@ export function deleteQueryInRichHistory(richHistory: RichHistoryQuery[], ts: nu store.setObject(RICH_HISTORY_KEY, updatedHistory); return updatedHistory; } catch (error) { - dispatch(notifyApp(createErrorNotification(error))); + dispatch(notifyApp(createErrorNotification('Saving rich history failed', error.message))); return richHistory; } }