Adding to Brian's comment: when you raise the new exception, you need to pass the argument as a keyword; e.g.:
raise exception.MalformedRequestBody(reason=_("malformed JSON in request body"))
Line 40 also has a capitalization inconsistency: 'Body' should be lowercase 'body'.
Line 66 can be more simply written as:
message = _("Malformed message body: %(reason)s)"
Adding to Brian's comment: when you raise the new exception, you need to pass the argument as a keyword; e.g.: MalformedReques tBody(reason= _("malformed JSON in request body"))
raise exception.
Line 40 also has a capitalization inconsistency: 'Body' should be lowercase 'body'.
Line 66 can be more simply written as:
message = _("Malformed message body: %(reason)s)"