check if error is a timeout

This commit is contained in:
Annika Hannig 2023-05-12 14:36:17 +02:00
parent 0873b84e68
commit e2b6272c71

View File

@ -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);
}