Raise without if condition | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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 Answer
+ 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