SoftFx/TTWebClient-Python

cancel_trade missing response

Serpens66 opened this issue · 1 comments

Hi,

thank you very much for this.

The cancel_trade and close_trade are missing the response. Since it returns nothing, I get alway None as response, even if the trade was not canceled.
So we need to differentiate if the cancel call was succesfull or not.

I made those methods return HTTP code with 'return client.getresponse().status'. Now you can understand what happened with the following status codes:

  • 204 - Ok. No content.
  • 400 - Bad Request. The request could not be understood by the server due to malformed syntax.
  • 401 - Unauthorized. The request requires user authentication.
  • 402 - Payment Required. Not enough money for the operation.
  • 403 - Forbidden. The request is forbidden due to limited access rights.
  • 404 - Not Found. Required trade was not found.
  • 410 - Gone. Off quotes or dealer reject.
  • 500 - Internal Server Error. The server encountered an unexpected condition which prevented it from fulfilling the request.