How to prevent exceptions bubbling up in C#? -
If I'm writing an orbit library, and at some point in that library I have the code to catch the exception, I do not want anyone who uses my library to know that this also happened - it must be invisible from the outside world.
However, if they have a "catch thrown exception" in the visual studio (as opposed to "catch users unwanted exceptions"), then the exception will will be visible to them .
Is there any way to avoid this?
The only way is that you can turn it off if you put a attribute on that method which is the exception Can throw. As others have said, it is better to avoid the exception altogether, but this feature will fulfill your wish.
Comments
Post a Comment