mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-22 06:57:49 +00:00
Wrap all update errors as Errors
This commit is contained in:
parent
2d891262a7
commit
6ed2fddd37
@ -1,3 +1,4 @@
|
|||||||
|
* Bugfix: wrap all errors from update as Error objects - prevents image cleanup on download failures [Pablo]
|
||||||
* Wait 10 seconds after sending SIGTERM and before sending SIGKILL when stopping a container [petrosagg]
|
* Wait 10 seconds after sending SIGTERM and before sending SIGKILL when stopping a container [petrosagg]
|
||||||
|
|
||||||
# v1.0.0
|
# v1.0.0
|
||||||
|
@ -303,6 +303,10 @@ executeSpecialActionsAndBootConfig = (env) ->
|
|||||||
if !_.isEmpty(bootConfigVars)
|
if !_.isEmpty(bootConfigVars)
|
||||||
device.setBootConfig(bootConfigVars)
|
device.setBootConfig(bootConfigVars)
|
||||||
|
|
||||||
|
wrapAsError = (err) ->
|
||||||
|
return err if _.isError(err)
|
||||||
|
return new Error(err.message ? err)
|
||||||
|
|
||||||
UPDATE_IDLE = 0
|
UPDATE_IDLE = 0
|
||||||
UPDATE_UPDATING = 1
|
UPDATE_UPDATING = 1
|
||||||
UPDATE_REQUIRED = 2
|
UPDATE_REQUIRED = 2
|
||||||
@ -448,7 +452,7 @@ application.update = update = (force) ->
|
|||||||
.catch (err) ->
|
.catch (err) ->
|
||||||
logSystemEvent(logTypes.updateAppError, app, err)
|
logSystemEvent(logTypes.updateAppError, app, err)
|
||||||
throw err
|
throw err
|
||||||
.catch(_.identity)
|
.catch(wrapAsError)
|
||||||
.filter(_.isError)
|
.filter(_.isError)
|
||||||
.then (failures) ->
|
.then (failures) ->
|
||||||
throw new Error(joinErrorMessages(failures)) if failures.length > 0
|
throw new Error(joinErrorMessages(failures)) if failures.length > 0
|
||||||
|
Loading…
Reference in New Issue
Block a user