Ticket #104 (new task)

Opened 6 years ago

Last modified 6 years ago

REST itf: uniform formatting of all exceptions

Reported by: bruno Owned by: bruno
Priority: major Milestone:
Component: REST/HTTP interface Version:
Keywords: Cc: lily-developers@…


In the REST interface, most exceptions are formatted by the class GenericExceptionMapper?.

However, errors produced by the framework itself or by messagebodyreaders are formatted differently. Should have a look into whether this can be improved.

While not a solution as-is, one thing to consider is formatting all exceptions through Kauri's representationbuilder.

Change History

comment:1 Changed 6 years ago by bruno

(In [4222]) REST itf: remove representationbuilder, it is not used (re #104).

comment:2 Changed 6 years ago by bruno

The representationbuilder was meanwhile re-added in r4232. Mostly for the reason that since it catches any Throwable, it will maybe report more errors than Restlet does (see also r4233).

However, the json-error formatting performed by the representationbuilder is different from what Lily does, if we are going to keep the repr. builder around we should align them.

comment:3 Changed 6 years ago by bruno

In [4813]:

REST itf: change exception formatting:

  • description is changed to be always the description of the status code
  • causes element contains message and type of the exceptions (as before), but without the stack trace detail
  • complete stackTrace is put in json as one string property

Upgrade to a newer Kauri snapshot which has the same formatting in its representation builder.
This partly addresses re #104. Some exceptions are currently not under our control, for example, when there's a syntax error in the submitted json.

Note: See TracTickets for help on using tickets.