original_docstring: 
          Callback when sending order failed on server.
          
docstring: Callback when sending order failed on server.
docstring_tokens: Callback when sending order failed on server .
code: def on_send_order_failed(self, status_code: str, request: Request):
          """
          Callback when sending order failed on server.
          """
          self.update_rate_limit(request)
  
          order = request.extra
          order.status = Status.REJECTED
          self.gateway.on_order(order)
  
          if request.response.text:
              data = request.response.json()
              error = data["error"]
              msg = f"委托失败，状态码：{status_code}，类型：{error['name']}, 信息：{error['message']}"
          else:
              msg = f"委托失败，状态码：{status_code}"
  
          self.gateway.write_log(msg)
code_tokens: def on_send_order_failed ( self , status_code : str , request : Request ) : self . update_rate_limit ( request ) order = request . extra order . status = Status . REJECTED self . gateway . on_order ( order ) if request . response . text : data = request . response . json ( ) error = data [ "error" ] msg = f"委托失败，状态码：{status_code}，类型：{error['name']}, 信息：{error['message']}" else : msg = f"委托失败，状态码：{status_code}" self . gateway . write_log ( msg )
short_docstring: Callback when sending order failed on server.
short_docstring_tokens: Callback when sending order failed on server .
comment: """
          Callback when sending order failed on server.
          """