|
From: Rick R. <ric...@fo...> - 2006-07-25 14:57:52
|
Hi, Once more, I've got some questions on the PipeParser.getCriticalResponseData() method. The method contains a catch (Exception e) block, which print a stack trace for the caught exception and throws a new one. Three things come to mind here: * Shouldn't catch (Exception e) really be a catch (specific exception), such as catch (HL7Exception e)? Catching all exceptions is typically a bad idea (see: http://www.javaworld.com/javaworld/javatips/jw-javatip134.html or http://javaalmanac.com/egs/Java%20Language/CatchThrowable.html?l=rel) * Can the e.printStackTrace() be removed, in favor of having the caller handle the exception? A library should typically not print messages to the console. * Can the caught exception be specified as nested exception of the newly created HL7Exception? If anybody wants, I can create a suggestion for a fix. Regards, Rick Riemer software engineer - forcare phone: +31 (30) 699 1930 mailto:ric...@fo... website: http://www.forcare.nl "The good thing about standards is that there are so many to choose from." (A. Tanenbaum, Computer Networks) |