Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Exception Handling (http://www.chiefdelphi.com/forums/showthread.php?t=113740)

PLAIDProgrammer 17-02-2013 01:37

Exception Handling
 
Although we would not like to be having exceptions at this stage in code, it happens. I was wondering weather other programmers catch exceptions or let them stop the code? Any help will really make my teams life much easier.
Lenny

gixxy 17-02-2013 02:05

Re: Exception Handling
 
I believe in catching errors and handling them rather than letting them crash code. Especially if you know what could cause them to happen.


This year a major example is our RaspberryPi, which we are using to process camera images. We them pipe the data back to the cRIO via TCP Socket. There will be times where something goes wrong and I will get an IOException, and I would rather have it handled gracefully and keep the robot running rather than it crash.

Cel Skeggs 18-02-2013 15:35

Re: Exception Handling
 
In our code base, we catch certain kinds of errors - anything that we know could be thrown (for example IOException or NumberFormatException) we will catch.
Most of the time, we don't try to catch exceptions if we don't know they'll be thrown - it's not useful to us to try to catch ArrayIndexOfOfBoundsException or NullPointerException, because generally they imply that there's a bug in our code that should be fixed.


All times are GMT -5. The time now is 10:13.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi