OK, let's agree to disagree
We live in a free world babe!
What is the "classic" exception regarding Databases?
- Try to connect with correct params, should work but it does not because cable is brocken/cut/disconnected/server down/wirefall/postgres down/postgres busy/bug
- Do an array of queries read/write with operations in the middle, and several went ok up to a point, and then, after some time, there is a failure due to internet timeout for example. 1000000 times you run same procedure and it works because no external issue happens in the middle. But 1000001 time it doesn't
It's the Login of a User.....
I see it too many times, that people have a typo in their username or password (happened enough times to me, too).
There is no other way to catch that "message" from the Database except using the "Exception"-mechanism, because you cannot lookup beforehand, if the login is correct/valid
Are you referring to the DB connection?
In this case I agree that the only mechanism can be to trap an exception (unless the db connector does not forsee a login method that returns false in case login credentials are invalid, without raising Exceptions), but this is not the case initially introduced.
I've seen it enough times, that e.g. the Database itself is designed by someone else, and you have to deal with it from the frontend
In a situation like this where there is a unknown design or a design error, of course one could reasonably use the exception handling, but IMHO this is not a valid reason to extend its usage to situations like the one we started from (prevent a dup key exception by doing a select before the insert).