Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JS SDK] Update Retry logic to handle additional response codes #1878

Merged
merged 1 commit into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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