#NEWLINE# def failure( self , exc ) : #NEWLINE# #INDENT# '\n        Report the response as a failure.\n        \n        exc can be either a python exception, or a string in which case it will\n        be wrapped inside a CatchResponseError. \n        \n        Example::\n        \n            with self.client.get("/", catch_response=True) as response:\n                if response.content == "":\n                    response.failure("No data")\n        ' #NEWLINE# if isinstance ( exc , basestring ) : #NEWLINE# #INDENT# exc = CatchResponseError ( exc ) #NEWLINE# #UNINDENT# events . request_failure . fire ( request_type = self . locust_request_meta [ 'method' ] , name = self . locust_request_meta [ 'name' ] , response_time = self . locust_request_meta [ 'response_time' ] , exception = exc ) #NEWLINE# self . _is_reported = True