GenHTTP icon indicating copy to clipboard operation
GenHTTP copied to clipboard

Add default structured error mapper

Open Kaliumhexacyanoferrat opened this issue 1 year ago • 0 comments

As a developer of a web service application, I would like my errors to be rendered as a structured message instead of HTML, so that I can handle it more cleanly in my clients.

Example

var errorHandling = ErrorHandler.Structured();
    
var api = Layout.Create()
                .AddService<...>()
                .Add(errorHandling);

Acceptance criteria

  • The functionality is implemented in the error handling module
  • The functionality accepts a Serialization instance to control supported formats
  • The handler renders public exception properties into the data structure
  • The project templates are extended to use this error handler
  • The feature is documented on the GenHTTP website
  • The feature is covered by acceptance tests

Kaliumhexacyanoferrat avatar Jan 05 '24 11:01 Kaliumhexacyanoferrat