mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-05-06 19:08:13 +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
|
# v2.1.0
|
||||||
|
|
||||||
* Pick up new variable from hostOS, pointing to the mount point of the hostOS's boot partition [Theodor]
|
* 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 :)
|
# 304 means the container was already started, precisely what we want :)
|
||||||
if statusCode is '304'
|
if statusCode is '304'
|
||||||
return
|
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
|
# If starting the container failed, we remove it so that it doesn't litter
|
||||||
container.removeAsync(v: true)
|
container.removeAsync(v: true)
|
||||||
.then ->
|
.then ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user