WHY IS IT A BAD IDEA TO THROW YOUR OWN EXCEPTIONS?

James Smith

Total Post:79

Points:395
Posted by  James Smith
C# 
C#
 1801  View(s)
Ratings:
Rate this:
  1. James Smith

    Post:79

    Points:395
    Why is it a bad idea to throw your own exceptions?

    Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!