original_docstring: 
          Callback to handle request failed.
          
docstring: Callback to handle request failed.
docstring_tokens: Callback to handle request failed .
code: def on_failed(self, status_code: int, request: Request):
          """
          Callback to handle request failed.
          """
          self.update_rate_limit(request)
  
          data = request.response.json()
          error = data["error"]
          msg = f"请求失败，状态码：{status_code}，类型：{error['name']}, 信息：{error['message']}"
          self.gateway.write_log(msg)
code_tokens: def on_failed ( self , status_code : int , request : Request ) : self . update_rate_limit ( request ) data = request . response . json ( ) error = data [ "error" ] msg = f"请求失败，状态码：{status_code}，类型：{error['name']}, 信息：{error['message']}" self . gateway . write_log ( msg )
short_docstring: Callback to handle request failed.
short_docstring_tokens: Callback to handle request failed .
comment: """
          Callback to handle request failed.
          """