mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-31 16:35:23 +00:00
Merge pull request #118 from resin-io/exec-format-error
Catch exec format error and provide friendlier message
This commit is contained in:
commit
c4f33d55ea
@ -1,3 +1,5 @@
|
||||
* Catch exec format error and provide friendlier error message [Aleksis]
|
||||
|
||||
# v2.1.0
|
||||
|
||||
* Pick up new variable from hostOS, pointing to the mount point of the hostOS's boot partition [Theodor]
|
||||
|
@ -248,6 +248,16 @@ application.start = start = (app) ->
|
||||
# 304 means the container was already started, precisely what we want :)
|
||||
if statusCode is '304'
|
||||
return
|
||||
|
||||
if statusCode is '500' and err.json.trim().match(/exec format error$/)
|
||||
# Provide a friendlier error message for "exec format error"
|
||||
device.getDeviceType()
|
||||
.then (deviceType) ->
|
||||
throw new Error("Application architecture incompatible with #{deviceType}: exec format error")
|
||||
else
|
||||
# rethrow the same error
|
||||
throw err
|
||||
.catch (err) ->
|
||||
# If starting the container failed, we remove it so that it doesn't litter
|
||||
container.removeAsync(v: true)
|
||||
.then ->
|
||||
|
Loading…
x
Reference in New Issue
Block a user