+ 1
Why/when did one needs to
raise an exception.
2 Réponses
+ 2
when you want to make your code reusable, you raise exception to warn people using your code that there's a problem.
a classic example is : you provide a divide fonction, and the user try to divide by zero ; in your function, you usually check that kind of problem and raise an exception if you find one
+ 2
thanks