Example #1
0
    def process_exception(self, request, exception):

        if isinstance(exception, FastResponse):
            error_info = {'error': exception.error_msg}
            json_resp = JsonResponse(error_info, status=exception.status_code)
            json_resp.content_type = 'application/json'
            return json_resp

        return None