Merge pull request #24 from navi-infra/INFRA-425
INFRA-425 | Abhishek | Improve alert messages
This commit is contained in:
@@ -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 (
|
||||
<div id="mainComponent">
|
||||
<MenuAppBar
|
||||
@@ -140,10 +144,7 @@ const Form = (props: any) => {
|
||||
}
|
||||
} else {
|
||||
toast.update(toastId, {
|
||||
render: formatDisplayData({
|
||||
error: resJson.error,
|
||||
message: resJson.message,
|
||||
}),
|
||||
render: getFormattedError(resJson),
|
||||
type: "error",
|
||||
autoClose: 5000,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user