Skip to content
Advertisement

Handle specific exception from python package

I would like to handle the following Exception from py_vollib/py_lets_be_rational in specific way.

JavaScript

Tried this without success:

JavaScript

what am I doing wrong? any help would be appreciated.

Advertisement

Answer

Looking at the implementation, you’re missing the period at the end of the sentence:

JavaScript

I don’t see the point in this check because that will always be the message the exception is created with.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement