How many argumwnts does throw function have in exception handling?
Answers
Answered by
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
English,
5 months ago
English,
5 months ago
Social Sciences,
11 months ago
Social Sciences,
1 year ago
Math,
1 year ago