mirror of
https://github.com/gradle/wrapper-validation-action
synced 2024-11-23 17:22:01 +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) {
|
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);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -25,7 +25,12 @@ export async function run(): Promise<void> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} 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)
|
core.setFailed(error.message)
|
||||||
} else {
|
} else {
|
||||||
core.setFailed(`Unknown object was thrown: ${error}`)
|
core.setFailed(`Unknown object was thrown: ${error}`)
|
||||||
|
|
Loading…
Reference in a new issue