Computer Science, asked by SaadTramboo6395, 11 months ago

How many argumwnts does throw function have in exception handling?

Answers

Answered by IonicYadav
0

Answer:

stated in your error, you can only re-throw exceptions (with throw;) from inside a catch block. IMHO this is really the only place it makes sense to do so as well; you are either catching the exception, or throwing it, and probably should not do both. From a method called ManageException, I wonder why you would be managing said exception, but throwing it anyway.

Perhaps you instead want to wrap the original exception in one of your own, providing additional details? In this case I would throw a new exception

Similar questions