We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 586ad4a commit 57fc012Copy full SHA for 57fc012
1 file changed
src/services/Vertex.tsx
@@ -98,10 +98,26 @@ export class VertexServices {
98
method: 'POST'
99
});
100
if (data.error) {
101
- toast.error(
102
- <ExpandToastMessage message={data.error} />,
103
- toastifyCustomStyle
+ const jsonstr = data?.error.slice(
+ data?.error.indexOf('{'),
+ data?.error.lastIndexOf('}') + 1
104
);
105
+ if (jsonstr) {
106
+ const errorObject = JSON.parse(jsonstr);
107
+ if (errorObject.error.message) {
108
+ toast.error(
109
+ `Error in creating schedule : ${errorObject.error.message}`,
110
+ {
111
+ ...toastifyCustomStyle
112
+ }
113
+ );
114
+ } else {
115
116
+ <ExpandToastMessage message={data.error} />,
117
+ toastifyCustomStyle
118
119
120
121
setCreatingVertexScheduler(false);
122
} else {
123
toast.success(
0 commit comments