mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-19 05:37:53 +00:00
Report failures to start the container (eg bad CMD in a Dockerfile)
This commit is contained in:
parent
84b5746111
commit
7a3d5b06c2
@ -143,6 +143,13 @@ exports.start = start = (app) ->
|
||||
'/var/run/docker.sock:/run/docker.sock'
|
||||
]
|
||||
)
|
||||
# Bluebird throws OperationalError for errors resulting in the normal execution of a promisified function.
|
||||
.catch Promise.OperationalError, (err) ->
|
||||
# Report the message from the original cause to the user.
|
||||
message = err.cause.json ? err.cause.message ? err.message
|
||||
logSystemEvent("Unable to start application #{app.imageId} due to:\n#{message}")
|
||||
# And rethrow the error, to be handled later as necessary.
|
||||
throw err
|
||||
.then ->
|
||||
updateDeviceState(commit: app.commit)
|
||||
logger.attach(app)
|
||||
|
Loading…
Reference in New Issue
Block a user