✅ Error handling in C#
Hello guys, consider the following code:
If I try to wrap the AgeVerification in a try catch block and pass a string instead of an int, my IDE yell an error at me, like its not a runtime exception (I think we say it's a checked exception), why is that? Even with the try catch. In my class Person, I didn't include a try catch in the method doing the work though.
Normally, should we also include try catch block in the Person class? Like for AgeVerification here?
If I try to wrap the AgeVerification in a try catch block and pass a string instead of an int, my IDE yell an error at me, like its not a runtime exception (I think we say it's a checked exception), why is that? Even with the try catch. In my class Person, I didn't include a try catch in the method doing the work though.
Normally, should we also include try catch block in the Person class? Like for AgeVerification here?