mirror of
https://github.com/gradle/wrapper-validation-action
synced 2024-11-27 10:42:03 +00:00
Log multiple errors
# What Log AggregateError type, when multiple errors are returned from HTTP client - fixes #174 # Why We would silently fail otherwise as error.message was empty for the AggregatedError exception.
This commit is contained in:
parent
2572bdd97b
commit
21bea8c867
2 changed files with 13 additions and 2 deletions
8
dist/index.js
vendored
8
dist/index.js
vendored
|
@ -28027,7 +28027,13 @@ async function run() {
|
|||
}
|
||||
}
|
||||
catch (error) {
|
||||
if (error instanceof Error) {
|
||||
if (error instanceof AggregateError) {
|
||||
core.setFailed(`Multiple errors returned`);
|
||||
for (const err of error.errors) {
|
||||
core.error(`Error ${error.errors.indexOf(err)}: ${err.message}`);
|
||||
}
|
||||
}
|
||||
else if (error instanceof Error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -25,7 +25,12 @@ export async function run(): Promise<void> {
|
|||
}
|
||||
}
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
if (error instanceof AggregateError) {
|
||||
core.setFailed(`Multiple errors returned`)
|
||||
for (const err of error.errors) {
|
||||
core.error(`Error ${error.errors.indexOf(err)}: ${err.message}`)
|
||||
}
|
||||
} else if (error instanceof Error) {
|
||||
core.setFailed(error.message)
|
||||
} else {
|
||||
core.setFailed(`Unknown object was thrown: ${error}`)
|
||||
|
|
Loading…
Reference in a new issue