Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default structured error mapper #443

Open
Kaliumhexacyanoferrat opened this issue Jan 5, 2024 · 0 comments
Open

Add default structured error mapper #443

Kaliumhexacyanoferrat opened this issue Jan 5, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Kaliumhexacyanoferrat
Copy link
Owner

Kaliumhexacyanoferrat commented Jan 5, 2024

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 Kaliumhexacyanoferrat added enhancement New feature or request good first issue Good for newcomers labels Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant