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


Are specific exceptions called before general exceptions in Python and C# ?

13th Apr 2019, 2:20 AM
Sanjay Kamath
Sanjay Kamath - avatar
3 Réponses
+ 5
Yes That is true. The most general exception is Exception. But if a more specific exception applies, then this block will handle the exception. Only one catch block handles the exception https://www.tutorialsteacher.com/csharp/csharp-exception-handling
13th Apr 2019, 8:10 PM
sneeze - avatar
+ 3
in C# General exception not called ,if in code use specific exception. After specific exception will call 'finally' part , if it exist.
13th Apr 2019, 8:58 AM
id001x - avatar
+ 3
Hi all!)
14th Feb 2020, 8:57 PM