Skip to content

Commit

Permalink
Display the reason for Heroku AppSetup failure (github#21683)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMGreene authored Sep 23, 2021
1 parent e4f7746 commit e29a965
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion script/deployment/deploy-to-staging.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,17 @@ export default async function deployToStaging({
}

if (appSetup && appSetup.status === 'failed') {
const manifestErrors = appSetup.manifest_errors || []
const hasManifestErrors = Array.isArray(manifestErrors) && manifestErrors.length > 0
const manifestErrorMessage = hasManifestErrors
? `\nManifest errors:\n - ${manifestErrors.join('\n - ')}`
: ''
throw new Error(
`Failed to setup app after ${Math.round(
(Date.now() - appSetupStartTime) / 1000
)} seconds. See Heroku logs for more information:\n${logUrl}`
)} seconds.
Reason: ${appSetup.failure_message}${manifestErrorMessage}
See Heroku logs for more information:\n${logUrl}`
)
}

Expand Down

0 comments on commit e29a965

Please sign in to comment.