When to use a user defined Exception and some good examples/best Practices?

Posted by Atomiton on Stack Overflow See other posts from Stack Overflow or by Atomiton
Published on 2010-04-08T14:17:18Z Indexed on 2010/04/08 14:23 UTC
Read the original article Hit count: 578

Filed under:
|
|
|

I would assume that most User-defined Exceptions are for Business Logic level exceptions, but what are some good reasons to use a User-Defined Exception and what are some good examples?

Is a user-defined exception's only advantage that you can define a consistent Error Message?

What logic can be written inside exceptions to make them truly more useful?

After all, can't you just do this: throw new Exception("Some Error Message");

© Stack Overflow or respective owner

Related posts about user-defined

Related posts about exception