KiteException

vijayonkite
When KiteException is thrown by kiteConnect.placeOrder or kiteConnect.modifyOrder, there can be number of reasons for the same. For example

1. Buy Price is less than lower circuit.
2. Sell price is higher than the upper circuit
3. Many more

Now based on the reasonI have to take a decision in my program. How do I know the exact reason for the exception, other than the KiteException.message. I don't want to rely on "message" as it can be changed in future by the Zerodha team.

Or if I have to rely on the KiteException.message, is there any Constant available for these messages, so that I can just use it and I don't have to worry about when its changed.

Thank you.
  • vijayonkite
    If I rely on the message, my program shall fail if the message is changed by the Zerodha Dev team.
  • vijayonkite
    vijayonkite edited November 2021
    Can someone please answer this? If my question is not clear, please ask for more explanation if I have missed something. thank you.
  • sujith
    In a broader sense you will have to use exception type but for specific cases detection you will have to rely on error message.
  • vijayonkite
    thanks a lot
This discussion has been closed.