1
0
mirror of synced 2025-12-22 11:26:57 -05:00

Announce if Heroku appears to be down (#21762)

This commit is contained in:
James M. Greene
2021-09-27 15:17:05 -05:00
committed by GitHub
parent f2adc093d1
commit deab27360c
6 changed files with 71 additions and 9 deletions

View File

@@ -143,6 +143,7 @@ export default async function deployToProduction({
body: appConfigVars,
})
} catch (error) {
announceIfHerokuIsDown(error)
throw new Error(`Failed to update Heroku app configuration variables. Error: ${error}`)
}
@@ -158,6 +159,7 @@ export default async function deployToProduction({
},
})
} catch (error) {
announceIfHerokuIsDown(error)
throw new Error(`Failed to create Heroku build. Error: ${error}`)
}
@@ -183,6 +185,7 @@ export default async function deployToProduction({
continue
}
}
announceIfHerokuIsDown(error)
throw new Error(`Failed to get build status. Error: ${error}`)
}
@@ -235,6 +238,7 @@ export default async function deployToProduction({
continue
}
}
announceIfHerokuIsDown(error)
throw new Error(`Failed to get release status. Error: ${error}`)
}
@@ -293,6 +297,7 @@ export default async function deployToProduction({
continue
}
}
announceIfHerokuIsDown(error)
throw new Error(`Failed to find dynos for this release. Error: ${error}`)
}
}
@@ -323,6 +328,7 @@ export default async function deployToProduction({
`Here are the last ${HEROKU_LOG_LINES_TO_SHOW} lines of the Heroku log:\n\n${logText}`
)
} catch (error) {
announceIfHerokuIsDown(error)
// Don't fail because of this error
console.error(`Failed to retrieve the Heroku logs for the crashed dynos. Error: ${error}`)
}
@@ -429,3 +435,9 @@ async function getTarballUrl({ octokit, owner, repo, sha }) {
})
return tarballUrl
}
function announceIfHerokuIsDown(error) {
if (error && error.statusCode === 503) {
console.error('💀 Heroku may be down! Please check its Status page: https://status.heroku.com/')
}
}