Skip to content

Commit

Permalink
Improve layer publishing error output
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanblock committed Feb 22, 2025
1 parent 11b5cd9 commit 0c6f7d5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/publish-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ let {
AddLayerVersionPermissionCommand,
PublishLayerVersionCommand,
} = require('@aws-sdk/client-lambda')
let currentRegion

try {
async function main () {
Expand All @@ -18,6 +19,7 @@ try {
// Publish to each region
let regions = await getRegions()
for (let region of regions) {
currentRegion = region
let lambda = new LambdaClient({ region })
let publish = new PublishLayerVersionCommand({
Content: { ZipFile },
Expand All @@ -43,6 +45,9 @@ try {
main()
}
catch (err) {
if (currentRegion) {
console.error(`Publishing failed on ${currentRegion}`)
}
console.error(err)
process.exit(1)
}

0 comments on commit 0c6f7d5

Please sign in to comment.