Extract common BadRequestException and RichRequest.