def METHOD_NAME(self, request, exception):
    encoder = self.get_encoder(request)
    locator = getattr(exception, "locator", None)
    code = getattr(exception, "code", None) or type(exception).__name__
    return (
        encoder.serialize(
            encoder.encode_exception(
                str(exception), code, locator
            ),
        ), 
        encoder.content_type, 
        400
    )