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
-
ArturS1098yBecause that way you can inform methds that this exception in the catch block has to be thrown.
-
I should add, that in the try-block there is some database action going on, and there the exception occurs. How should I know what went wrong in the database on the clients PC if nothing is catched and logged?
Not to speak of the commented "CloseConnection()" 😠-
ArturS1098y@katho2404
Server side logging and user error reporting is your answer ;) also what is wrong with closing the connection besides the naming convention amd the fact that its commented out? -
It's the fact that it's commented out!
And it's a local database at the user's PC.
Unfortunately most of the catch blocks, if there are any, look like this or similar. There is not really any usable logging. -
ArturS1098yThen make the user to send logs that you append to a file or smth or make the software upload it to your remote server. Local database is not a very good practice tho. Well it depends on the application tho. But the fact that the connection is not closed bothers me aswell
-
The local database is necessary for the application. It's a 10 year old WinForms project, handed on from dev to dev... The code looks like it too..
But yeah, your idea was what I was going to do ;)
Related Rants
-
trogus64New devRant web app for desktop is now live! (https://devrant.com - the .com will now redirect to feed if you ...
-
c3rberus11699% of the devs be like catch(Exception e) { // Not a single fuck given }
-
SMtengwana4Was going through some old gadgets n found this fossil. Give me the fucken code Blackberry and I'll catch it ...
...
catch (Exception)
{
throw new Exception();
}
finally
{
//CloseConnection();
}
Why? Oh Why????
undefined
catch
crappycode
finally