check if error is a timeout
This commit is contained in:
parent
0873b84e68
commit
e2b6272c71
@ -40,3 +40,9 @@ export const ErrorsProvider = ({children}) => {
|
||||
);
|
||||
}
|
||||
|
||||
// Check if the error (if present) has a status code
|
||||
// that matches a gateway or a request timeout.
|
||||
export const isTimeoutError = (error) => {
|
||||
const status = error?.response?.status;
|
||||
return (status === 504 || status === 408);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user