Skip to content

Commit 0184319

Browse files
committed
fix(interceptorService): Corrected the way error handling is done if the error happens during actual
1 parent 67ea3ce commit 0184319

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/interceptor-service.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,14 @@ export class InterceptorService extends Http {
286286
startFrom = this.interceptors.length - 1;
287287
}
288288

289+
// If error occurred when making actual server call, lets start from last interceptor in the chain
290+
if (startFrom === this.interceptors.length) {
291+
startFrom = this.interceptors.length - 1;
292+
}
293+
289294
for (let index = startFrom; index >= 0; index--) {
290295
const interceptor: Interceptor = this.interceptors[index];
291-
if (!interceptor.onResponse) {
296+
if (interceptor.onResponse === undefined) {
292297
continue;
293298
}
294299

0 commit comments

Comments
 (0)