aphiria / configuration

[READ-ONLY] The configuration library for Aphiria
https://www.aphiria.com
MIT License
1 stars 0 forks source link

Allow configuration of exception response factories #3

Closed davidbyoung closed 5 years ago

davidbyoung commented 5 years ago

Modules might want to map exceptions to HTTP responses. In this case, we should add a component that enables modules to register new exception response factories. It would also be useful to be able to customize the log levels for certain exception types.

davidbyoung commented 5 years ago

I think it would be relatively rare for a log level to be customized for an exception (they're usually just LogLevel::ERROR). However, mapping an exception to an HTTP response will be much more common (eg a UserNotFoundException mapping to a 404 response). So, I think it makes sense to keep these as two separate things to configure.

davidbyoung commented 5 years ago

Implemented in 67979e7f4ba897a5c36ab19a7eeedd0ccf69dd60