@@ -54,16 +54,21 @@ const StatefulSet = ({ name, namespace }: Props) => {
54
54
setStatefulSet ( res . data ) ;
55
55
} )
56
56
. catch ( ( error ) => {
57
- console . log ( error ) ;
58
- if ( error . response === undefined ) {
57
+ if ( error ?. response ?. data ) {
58
+ setError ( {
59
+ message : error . response . data . message || String ( error ) ,
60
+ description :
61
+ error . response . data . description ||
62
+ "Check if Cyclops backend is available on: " +
63
+ window . __RUNTIME_CONFIG__ . REACT_APP_CYCLOPS_CTRL_HOST ,
64
+ } ) ;
65
+ } else {
59
66
setError ( {
60
67
message : String ( error ) ,
61
68
description :
62
69
"Check if Cyclops backend is available on: " +
63
70
window . __RUNTIME_CONFIG__ . REACT_APP_CYCLOPS_CTRL_HOST ,
64
71
} ) ;
65
- } else {
66
- setError ( error . response . data ) ;
67
72
}
68
73
} ) ;
69
74
}
@@ -185,16 +190,21 @@ const StatefulSet = ({ name, namespace }: Props) => {
185
190
}
186
191
} )
187
192
. catch ( ( error ) => {
188
- console . log ( error ) ;
189
- if ( error . response === undefined ) {
193
+ if ( error ?. response ?. data ) {
194
+ setError ( {
195
+ message : error . response . data . message || String ( error ) ,
196
+ description :
197
+ error . response . data . description ||
198
+ "Check if Cyclops backend is available on: " +
199
+ window . __RUNTIME_CONFIG__ . REACT_APP_CYCLOPS_CTRL_HOST ,
200
+ } ) ;
201
+ } else {
190
202
setError ( {
191
203
message : String ( error ) ,
192
204
description :
193
205
"Check if Cyclops backend is available on: " +
194
206
window . __RUNTIME_CONFIG__ . REACT_APP_CYCLOPS_CTRL_HOST ,
195
207
} ) ;
196
- } else {
197
- setError ( error . response . data ) ;
198
208
}
199
209
} ) ;
200
210
} ;
@@ -291,17 +301,24 @@ const StatefulSet = ({ name, namespace }: Props) => {
291
301
}
292
302
} )
293
303
. catch ( ( error ) => {
294
- console . log ( error ) ;
295
- if ( error . response === undefined ) {
304
+ if ( error ?. response ?. data ) {
305
+ setError ( {
306
+ message :
307
+ error . response . data . message || String ( error ) ,
308
+ description :
309
+ error . response . data . description ||
310
+ "Check if Cyclops backend is available on: " +
311
+ window . __RUNTIME_CONFIG__
312
+ . REACT_APP_CYCLOPS_CTRL_HOST ,
313
+ } ) ;
314
+ } else {
296
315
setError ( {
297
316
message : String ( error ) ,
298
317
description :
299
318
"Check if Cyclops backend is available on: " +
300
319
window . __RUNTIME_CONFIG__
301
320
. REACT_APP_CYCLOPS_CTRL_HOST ,
302
321
} ) ;
303
- } else {
304
- setError ( error . response . data ) ;
305
322
}
306
323
} ) ;
307
324
setLogsModal ( {
@@ -327,7 +344,7 @@ const StatefulSet = ({ name, namespace }: Props) => {
327
344
open = { logsModal . on }
328
345
onOk = { handleCancelLogs }
329
346
onCancel = { handleCancelLogs }
330
- cancelButtonProps = { { style : { display : ' none' } } }
347
+ cancelButtonProps = { { style : { display : " none" } } }
331
348
width = { "60%" }
332
349
>
333
350
< Tabs items = { getTabItems ( ) } onChange = { onLogsTabsChange } />
0 commit comments