#NEWLINE# @ webob . dec . wsgify ( RequestClass = Request ) #NEWLINE# def __call__( self , request ) : #NEWLINE# #INDENT# 'Return the wrapped exception with a serialized body conforming\n        to our error format.\n        ' #NEWLINE# user_locale = request . best_match_language ( ) #NEWLINE# content_type = request . best_match_content_type ( ) #NEWLINE# metadata = { #NEWLINE# #INDENT# 'attributes' : { #NEWLINE# #INDENT# 'overLimit' : [ 'code' , 'retryAfter' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# self . content [ 'overLimit' ] [ 'message' ] = gettextutils . translate ( self . content [ 'overLimit' ] [ 'message' ] , user_locale ) #NEWLINE# self . content [ 'overLimit' ] [ 'details' ] = gettextutils . translate ( self . content [ 'overLimit' ] [ 'details' ] , user_locale ) #NEWLINE# xml_serializer = XMLDictSerializer ( self , XMLNS_V11 ) #NEWLINE# serializer = { #NEWLINE# #INDENT# 'application/xml' : xml_serializer , #NEWLINE# 'application/json' : JSONDictSerializer ( ) , #NEWLINE# #UNINDENT# } [ content_type ] #NEWLINE# content = serializer . serialize ( self . content ) #NEWLINE# self . wrapped_exc . body = content #NEWLINE# self . wrapped_exc . content_type = content_type #NEWLINE# return self . wrapped_exc