balena-supervisor/src
Roman Mazur 8b4c9837fa
Unify API errors processing
With this change, we define a custom error handler as express middleware
which renders 503 error with JSON response that includes status and message
fields.

The handler also logs the error, so the stack can be inspected in supervisor
logs. It's also a point where we can report the error to analytics services.

This removes a bunch of error handlers written in every request handler
function. Behaviour should remain unchanged except the fact that
/healthy endpoint now returns 503 in case of failure instead of 500.

Change-type: patch
Signed-off-by: Roman Mazur <roman@balena.io>
2019-09-23 17:20:38 +03:00
..
compose Correctly handle partial IPAM configurations for networks 2019-09-16 12:27:06 +01:00
config Dont try to set the commit if it's undefined 2019-07-10 14:25:21 +01:00
device-api Unify API errors processing 2019-09-23 17:20:38 +03:00
lib Add journald format flag 2019-08-21 15:02:05 +01:00
logging Catch and report cloud stream writing errors 2019-09-18 08:48:26 +01:00
migrations Clean up local mode engine objects using snapshots 2019-06-26 17:40:01 +03:00
types Specify TODO in DeviceApplicationState comment 2019-01-08 11:59:56 +00:00
api-binder.ts Unify API errors processing 2019-09-23 17:20:38 +03:00
app.ts Add more typescript conversions and export utilities from existing 2019-07-09 13:21:05 +01:00
application-manager.coffee Correctly generate network or volume creation steps 2019-08-21 10:48:38 +01:00
application-manager.d.ts Extract composition step work out to typescript compose module 2019-08-19 17:00:39 +01:00
db.ts Use dictionary for db key 2019-01-23 16:30:43 +00:00
device-config.ts fix: Always reboot when applying boot config 2019-07-22 16:07:39 +01:00
device-state.coffee device-state: correctly call volume creation on backup restore step 2019-09-11 12:11:05 +01:00
device-state.d.ts Add more typescript conversions and export utilities from existing 2019-07-09 13:21:05 +01:00
event-tracker.ts Add more typescript conversions and export utilities from existing 2019-07-09 13:21:05 +01:00
host-config.ts refactor: Change config modules export type to new-style 2019-01-02 18:12:22 +00:00
local-mode.ts Filter both null and omitted values 2019-07-25 13:03:04 +03:00
logger.ts Don't attempt to setup a log stream to the cloud before provision 2019-07-09 13:21:05 +01:00
network.ts Standardise all supervisor output logging 2019-06-10 11:38:45 +01:00
proxyvisor.coffee Standardise all supervisor output logging 2019-06-10 11:38:45 +01:00
supervisor-api.ts Unify API errors processing 2019-09-23 17:20:38 +03:00
supervisor.ts Don't attempt to setup a log stream to the cloud before provision 2019-07-09 13:21:05 +01:00