0
votes
2answers
150 views

IllegalStateException vs. IllegalArgumentException

In have written a function which expects the caller to pass in a configuration file like XML. Then I parse this given file and extract something which i then return. In this function (at least) two ...
2
votes
1answer
115 views

Passing multiple errors back from service layer

I am using Spring for a web application. To validate a user's input in a form such as for creating a Person entity I user JSR 303 validation to check for not null/empty or valid patterns etc.. Some ...
3
votes
5answers
628 views

How should I handle exception that *should* never be thrown? [duplicate]

What is the best way to handle errors that shouldn't ever happen? My current way to do this is to throw an exception if the 'thing that shouldn't happen' does happen, like so: /* * Restoring from a ...
54
votes
11answers
4k views

I've been told that Exceptions should only be used in exceptional cases. How do I know if my case is exceptional?

My specific case here is that the user can pass in a string into the application, the application parses it and assigns it to structured objects. Sometimes the user may type in something invalid. ...
2
votes
3answers
785 views

Good practice or service for monitoring unhandled application errors for a small organization

I'm working with multiple software with varying ways of monitoring for errors. When I make software, I usually send email with the stack trace to admins(usually me). Some customer software is ...