File tree 2 files changed +7
-1
lines changed
containers/Tenant/Query/QueryResult/components/QueryResultError
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { cn } from '../../../../../../utils/cn' ;
2
2
import { parseQueryError } from '../../../../../../utils/query' ;
3
+ import { isNetworkError } from '../../../../../../utils/response' ;
3
4
import { ResultIssues } from '../../../Issues/Issues' ;
4
5
import { isQueryCancelledError } from '../../../utils/isQueryCancelledError' ;
5
6
@@ -16,6 +17,10 @@ export function QueryResultError({error}: {error: unknown}) {
16
17
return null ;
17
18
}
18
19
20
+ if ( isNetworkError ( error ) ) {
21
+ return < div className = { b ( 'message' ) } > { error . message } </ div > ;
22
+ }
23
+
19
24
if ( typeof parsedError === 'object' ) {
20
25
return < ResultIssues data = { parsedError } /> ;
21
26
}
Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ export const isNetworkError = (error: unknown): error is NetworkError => {
7
7
error &&
8
8
typeof error === 'object' &&
9
9
'message' in error &&
10
- error . message === 'Network Error' ,
10
+ typeof error . message === 'string' &&
11
+ error . message . toLowerCase ( ) === 'network error' ,
11
12
) ;
12
13
} ;
13
14
You can’t perform that action at this time.
0 commit comments