diff --git a/dist/index.js b/dist/index.js index 74be01a..3c88aad 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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 { diff --git a/src/main.ts b/src/main.ts index 98096e4..041a3d4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -25,7 +25,12 @@ export async function run(): Promise { } } } 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}`)