Skip to content

Commit

Permalink
Merge pull request #227 from AdiRishi/arishi-secrets-error
Browse files Browse the repository at this point in the history
(enhancement): Surface inner exception when secret:bulk upload command fails
  • Loading branch information
1000hz committed Jan 5, 2024
2 parents 2521ec0 + b927195 commit 522c117
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/sixty-moons-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler-action": patch
---

Surface inner exception when secret:bulk upload command fails
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
endGroup as originalEndGroup,
error as originalError,
info as originalInfo,
debug,
startGroup as originalStartGroup,
setFailed,
setOutput,
Expand Down Expand Up @@ -204,7 +205,11 @@ async function uploadSecrets() {
),
),
});
} catch (err) {
} catch (err: unknown) {
if (err instanceof Error) {
error(err.message);
err.stack && debug(err.stack);
}
throw new Error(`Failed to upload secrets.`);
} finally {
endGroup();
Expand Down

0 comments on commit 522c117

Please sign in to comment.