From aba4aac520b41cc2f8aa3da8e78b32ecbc7f191e Mon Sep 17 00:00:00 2001 From: Abhishek Katiyar Date: Mon, 10 Aug 2020 16:59:35 +0530 Subject: [PATCH] INFRA-425 | Abhishek | Improve alert messages --- src/components/manifest/Form.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/manifest/Form.tsx b/src/components/manifest/Form.tsx index 50d4df3..087353a 100644 --- a/src/components/manifest/Form.tsx +++ b/src/components/manifest/Form.tsx @@ -79,6 +79,10 @@ const Form = (props: any) => { }); }; + function getFormattedError(resJson) { + return resJson.message.startsWith("java.lang.RuntimeException:") ? (String(resJson.message)).substr(27) : resJson.message; + } + return (
{ } } else { toast.update(toastId, { - render: formatDisplayData({ - error: resJson.error, - message: resJson.message, - }), + render: getFormattedError(resJson), type: "error", autoClose: 5000, });