Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
HOLD UP.
Dilettante alert 😂🤦
Not catching the possible exception is basically asking for trouble. -
Show him the below line, and you'll change his life forever.
Ok ready?
Here it goes:
e.printStackTrance() -
orimligt4485y@pmso I get your point and I agree to a high degree, but I also think that it depends on which type of application it is and who the end users are. Logging should always be done, and some exceptions doesn't have to be shown to the user and could be catched with a catch all. When using an application catch-all we can gracefully exit. The reasoning behind only catching the errors we could expect is that we know how to handle them. On that track, in my taste exceptions should never origin from our own code, but rather from sources we can't control.
-
Well. He has a point.
If you are going to catch an exception you really need to do something useful with it.
Hiding errors behind generic error messages is evil. -
@ReverendLovejoy Without proper logging, yes. But in most cases attempting a graceful exit from an unknown state is still preferred to just crashing the app.
-
@Lor-inc I agree. Sadly that seldom happens. In many situations people are so focused on the happy-path that they don't even know how to exit their own code when the unexpected happens.
Related Rants
I heard scary thing.
A tester found an issue yesterday. He came to the dev and reported about it. Apparently the only feedback message was "something went wrong". They spend almost an hour hunting down the cause for that. It turned out the error message was from one of the try-catch. I do not know much details apart from that. At the end, the dev lead said this (which he had said before).
"That's why I don't like to catch exception."
rant
java
exception