mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-03-10 22:44:29 +00:00
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>