« Previous | Next » 

Revision 1f8588f6

ID1f8588f6691bae503f7deb3e07278f1df8f48b00

Added by Iustin Pop about 15 years ago

RAPI: format error messages as JSON

This patch changes the format of the HTTP error messages from text/html, which
is hard to parse from RAPI clients, to JSON which can be automatically parsed.

The error message is an object, which contains always three keys:
- code, an integer with the error code
- message, a short description
- explain, holding (if available) a description of the error

In order to implement this, there is a bit of change to the http server
and executor classes. I've tested and the error handling still works
(but less optimal, no error message) in case the error formatting itself
raises an exception.

Reviewed-by: imsnah

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences