How to map custom exceptions onto HTTP error responses.