Default policy don't retry on canceled call

This commit is contained in:
Julien Antony 2017-10-11 08:50:18 +02:00
Родитель 37e4b49352
Коммит f6ba178869
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -128,8 +128,8 @@ export let SimpleWebRequestOptions: SimpleWebRequestOptions = {
};
export function DefaultErrorHandler(webRequest: SimpleWebRequest<any>, errResp: WebErrorResponse) {
if (!errResp.statusCode || errResp.statusCode >= 400 && errResp.statusCode < 600) {
// Fail 0/4xx/5xx requests immediately. These are permenent failures, and shouldn't have retry logic applied to them.
if (errResp.canceled || !errResp.statusCode || errResp.statusCode >= 400 && errResp.statusCode < 600) {
// Fail canceled/0/4xx/5xx requests immediately. These are permenent failures, and shouldn't have retry logic applied to them.
return ErrorHandlingType.DoNotRetry;
}