Skip to content

Commit

Permalink
Update Retry logic to handle additional response codes (#1878)
Browse files Browse the repository at this point in the history
  • Loading branch information
MSNev committed Aug 11, 2022
1 parent 6ba2c0d commit ae6daa2
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 165 deletions.
8 changes: 6 additions & 2 deletions channels/applicationinsights-channel-js/src/Sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -928,10 +928,14 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
* @param statusCode
*/
function _isRetriable(statusCode: number): boolean {
return statusCode === 408 // Timeout
return statusCode === 401 // Unauthorized
|| statusCode === 403 // Forbidden
|| statusCode === 408 // Timeout
|| statusCode === 429 // Too many requests.
|| statusCode === 500 // Internal server error.
|| statusCode === 503; // Service unavailable.
|| statusCode === 502 // Bad Gateway.
|| statusCode === 503 // Service unavailable.
|| statusCode === 504; // Gateway timeout.
}

function _formatErrorMessageXhr(xhr: XMLHttpRequest, message?: string): string {
Expand Down
Loading

0 comments on commit ae6daa2

Please sign in to comment.