dimanche 19 avril 2020

How to simplify the following if else ladder [closed]

try :
     .....
except Exception as e:
    if str1 in str(e):
            raise ExceptionOne(message)
    elif str2 in str(e):
            '''make some api calls'''

How to actually simplify the above piece of code.

Aucun commentaire:

Enregistrer un commentaire