Skip to content

Commit

Permalink
fix: onError interceptor should work also for cancelled requests
Browse files Browse the repository at this point in the history
  • Loading branch information
MattCCC committed Sep 17, 2024
1 parent ecbf995 commit d0ac1f3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/request-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,10 @@ function createRequestHandler(
error: ResponseError,
requestConfig: RequestConfig,
): void => {
if (isRequestCancelled(error)) {
return;
if (!isRequestCancelled(error)) {
logger('API ERROR', error);
}

logger('API ERROR', error);

// Invoke per request "onError" interceptor
if (requestConfig.onError) {
requestConfig.onError(error);
Expand Down

0 comments on commit d0ac1f3

Please sign in to comment.