mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-20 17:52:51 +00:00
Fix the message shown when docker gives a 500 error when starting a container
The test for an exec format error caused a `err.json.trim` is not a function error so the message shown didn't relate to what the problem actually was. This makes the test for the exec format error safer. Change-Type: patch Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
This commit is contained in:
parent
49d149a196
commit
279ab60233
@ -244,6 +244,12 @@ shouldMountKmod = (image) ->
|
||||
console.error('Error getting app OS release: ', err)
|
||||
return false
|
||||
|
||||
isExecFormatError = (err) ->
|
||||
message = ''
|
||||
try
|
||||
message = err.json.trim()
|
||||
/exec format error$/.test(message)
|
||||
|
||||
application.start = start = (app) ->
|
||||
device.isResinOSv1().then (isV1) ->
|
||||
volumes = utils.defaultVolumes(isV1)
|
||||
@ -319,7 +325,7 @@ application.start = start = (app) ->
|
||||
alreadyStarted = true
|
||||
return
|
||||
|
||||
if statusCode is '500' and err.json.trim().match(/exec format error$/)
|
||||
if statusCode is '500' and isExecFormatError(err)
|
||||
# Provide a friendlier error message for "exec format error"
|
||||
device.getDeviceType()
|
||||
.then (deviceType) ->
|
||||
|
Loading…
x
Reference in New Issue
Block a user