mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-02 10:13:36 +08:00
Improve error messages (duplicate artifacts; too many artifacts) (#1600)
* cleaning up error messages * updating package-json * updating package-lock * . * . * testing return message * updating error check * adding test * rmv unused var * updating status code to match conflict message
This commit is contained in:
@@ -84,13 +84,15 @@ class ArtifactHttpClient implements Rpc {
|
||||
debug(`[Response] - ${response.message.statusCode}`)
|
||||
debug(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`)
|
||||
debug(`Body: ${body}`)
|
||||
|
||||
if (this.isSuccessStatusCode(statusCode)) {
|
||||
return {response, body}
|
||||
}
|
||||
|
||||
isRetryable = this.isRetryableHttpStatusCode(statusCode)
|
||||
errorMessage = `Failed request: (${statusCode}) ${response.message.statusMessage}`
|
||||
const responseMessage = JSON.parse(body).msg
|
||||
if (responseMessage) {
|
||||
errorMessage = `${errorMessage}: ${responseMessage}`
|
||||
}
|
||||
} catch (error) {
|
||||
isRetryable = true
|
||||
errorMessage = error.message
|
||||
|
||||
Reference in New Issue
Block a user