From d3a4e34b3faeccbce49a7afb65cb2ac69494c528 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 20 Jan 2022 13:37:20 +0000 Subject: [PATCH] Don't show a notification if there is no error message --- packages/client/src/api.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/client/src/api.js b/packages/client/src/api.js index 911d421844..e617dae00f 100644 --- a/packages/client/src/api.js +++ b/packages/client/src/api.js @@ -18,7 +18,9 @@ export const API = createAPIClient({ // We could also log these to sentry. // Or we could check error.status and redirect to login on a 403 etc. onError: error => { - notificationStore.actions.error(error.message) + if (error.message) { + notificationStore.actions.error(error.message) + } }, // Patch certain endpoints with functionality specific to client apps