This is an automated email from the ASF dual-hosted git repository.

xhsun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new f9a2740  [TE] frontend - harleyjj/alert-details - surface message from 
500 response to user in alert preview (#3954)
f9a2740 is described below

commit f9a27402948bf81dea50f0f090300571f8e45311
Author: Harley Jackson <[email protected]>
AuthorDate: Tue Mar 12 07:11:30 2019 -0700

    [TE] frontend - harleyjj/alert-details - surface message from 500 response 
to user in alert preview (#3954)
---
 .../app/pods/components/alert-details/component.js                | 2 +-
 thirdeye/thirdeye-frontend/app/utils/utils.js                     | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js 
b/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
index 182e6d4..aa6be01 100644
--- a/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
+++ b/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
@@ -523,7 +523,7 @@ export default Component.extend({
         });
       }
     } catch (error) {
-      notifications.error('Preview alert failed', error);
+      notifications.error(error.body.message);
     }
 
     return {
diff --git a/thirdeye/thirdeye-frontend/app/utils/utils.js 
b/thirdeye/thirdeye-frontend/app/utils/utils.js
index 9be8a95..40846be9 100644
--- a/thirdeye/thirdeye-frontend/app/utils/utils.js
+++ b/thirdeye/thirdeye-frontend/app/utils/utils.js
@@ -24,6 +24,14 @@ export function checkStatus(response, mode = 'get', 
recoverBlank = false, isYaml
       return (mode === 'get' || isYamlPreview) ? response.json() : 
JSON.parse(JSON.stringify(response));
     }
   } else {
+    if (isYamlPreview) {
+      return response.json()
+              .then(data => {
+                const error = new Error(data);
+                error.body= data;
+                throw error;
+              })
+    }
     const error = new Error(response.statusText);
     error.response = response;
     if (recoverBlank) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to