mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-30 08:03:59 +00:00
Provide a better error message when app is not found for purging
This commit is contained in:
parent
f38715177f
commit
5bcff712dc
@ -1,3 +1,4 @@
|
||||
* Provide a better error message when app is not found for purging [Pablo]
|
||||
* Only iterate through remote apps to set device config [Pablo]
|
||||
|
||||
# v2.8.1
|
||||
|
@ -113,12 +113,15 @@ module.exports = (application) ->
|
||||
.finally ->
|
||||
application.start(app)
|
||||
.catch (err) ->
|
||||
status = 503
|
||||
if err instanceof utils.AppNotFoundError
|
||||
errMsg = "App not found: an app needs to be installed for purge to work.
|
||||
If you've recently moved this device from another app,
|
||||
please push an app and wait for it to be installed first."
|
||||
err = new Error(errMsg)
|
||||
status = 400
|
||||
application.logSystemMessage("Error purging /data: #{err}", { appId, error: err }, 'Purge /data error')
|
||||
throw err
|
||||
.catch utils.AppNotFoundError, (e) ->
|
||||
return res.status(400).send(e.message)
|
||||
.catch (err) ->
|
||||
res.status(503).send(err?.message or err or 'Unknown error')
|
||||
res.status(status).send(err?.message or err or 'Unknown error')
|
||||
|
||||
unparsedRouter.post '/v1/tcp-ping', (req, res) ->
|
||||
utils.disableCheck(false)
|
||||
|
Loading…
x
Reference in New Issue
Block a user