Raise without if condition | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 3

Raise without if condition

How does it make sense to Raise an exception outside a condition check using If.

27th Jan 2018, 2:57 PM
AJESH KUMAR
AJESH KUMAR - avatar
1 Réponse
+ 3
you can make a method which constructs an exception from some string describing it, when you want to add some information to every exception's description (like values of variables)
27th Jan 2018, 3:40 PM
michal