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

Improve error messages (duplicate artifacts; too many artifacts) #1600

Merged
merged 10 commits into from
Dec 11, 2023
Merged
Changes from 6 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
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class ArtifactHttpClient implements Rpc {
): Promise<{response: HttpClientResponse; body: string}> {
let attempt = 0
let errorMessage = ''
let errorResponse = ''
while (attempt < this.maxAttempts) {
let isRetryable = false

Expand All @@ -84,11 +85,10 @@ class ArtifactHttpClient implements Rpc {
debug(`[Response] - ${response.message.statusCode}`)
debug(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`)
debug(`Body: ${body}`)

errorResponse = body
if (this.isSuccessStatusCode(statusCode)) {
return {response, body}
}

isRetryable = this.isRetryableHttpStatusCode(statusCode)
errorMessage = `Failed request: (${statusCode}) ${response.message.statusMessage}`
} catch (error) {
Expand All @@ -97,7 +97,7 @@ class ArtifactHttpClient implements Rpc {
}

if (!isRetryable) {
throw new Error(`Received non-retryable error: ${errorMessage}`)
throw new Error(`Received non-retryable error: ${errorResponse}`)
}

if (attempt + 1 === this.maxAttempts) {
Expand Down
Loading