HUE-1762 [dbquery] Show errors in the UI in case of DB connection failure

Added an error decorator for APIs that catches all exceptions
and forms a JSON response with an error message.