handle errors

This commit is contained in:
Annika Hannig 2023-05-12 14:36:42 +02:00
parent e2b6272c71
commit a3c276a3e0

View File

@ -21,7 +21,7 @@ import { RoutesReceivedContext
from 'app/context/routes';
import { ApiStatusProvider }
from 'app/context/api-status';
import { useErrorHandler }
import { useErrorHandler, isTimeoutError }
from 'app/context/errors';
import { useQuery
, PARAM_QUERY
@ -166,7 +166,12 @@ const useSearchResults = ({
loading: false,
},
}));
handleError(error);
// We handle timeout errors ourself. All other errors
// are handled by the global error handler.
if(!isTimeoutError(error)) {
handleError(error);
}
});
}, [searchUrl, setState, handleError]);