Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
response.status
}. `;
logMessage = errorString;
currentLevel = HttpPipelineLogLevel.ERROR;
}
const messageInfo = `Request try:${this.tryCount}, status:${
response.status
} request duration:${requestCompletionTime} ms, operation duration:${operationDuration} ms\n`;
this.log(currentLevel, logMessage + messageInfo);
return response;
} catch (err) {
this.log(
HttpPipelineLogLevel.ERROR,
`Unexpected failure attempting to make request. Error message: ${err.message}`
);
throw err;
}
}
}
if (
(response.status >= 400 &&
response.status <= 499 &&
(response.status !== HTTPURLConnection.HTTP_NOT_FOUND &&
response.status !== HTTPURLConnection.HTTP_CONFLICT &&
response.status !== HTTPURLConnection.HTTP_PRECON_FAILED &&
response.status !== HTTPURLConnection.HTTP_RANGE_NOT_SATISFIABLE)) ||
(response.status >= 500 && response.status <= 509)
) {
const errorString = `REQUEST ERROR: HTTP request failed with status code: ${
response.status
}. `;
logMessage = errorString;
currentLevel = HttpPipelineLogLevel.ERROR;
}
const messageInfo = `Request try:${this.tryCount}, status:${
response.status
} request duration:${requestCompletionTime} ms, operation duration:${operationDuration} ms\n`;
this.log(currentLevel, logMessage + messageInfo);
return response;
} catch (err) {
this.log(
HttpPipelineLogLevel.ERROR,
`Unexpected failure attempting to make request. Error message: ${err.message}`
);
throw err;
}
}