Re: [IMAGING] Logging vs Throwing exceptions

2023-05-31 Thread Gary Gregory
Miguel, Don't cut off the thread in the body of the email please. Gary On Wed, May 31, 2023, 01:49 Miguel Muñoz wrote: > > In addition to logging and swallowing the exception, this method also then > returns null. This is also a bad practice. > > ​ > > ​The caller has to check for null. One of

Re: [IMAGING] Logging vs Throwing exceptions

2023-05-31 Thread Peter Hull
That whole class looks like it needs a bit of TLC (or Javadoc at least!) On Wed, 31 May 2023 at 06:49, Miguel Muñoz wrote: > > > In addition to logging and swallowing the exception, this method also then > returns null. This is also a bad practice. > > > > The caller has to check for null. One o

Re: [IMAGING] Logging vs Throwing exceptions

2023-05-30 Thread Miguel Muñoz
In addition to logging and swallowing the exception, this method also then returns null. This is also a bad practice. ​ ​The caller has to check for null. One of the reasons exceptions were invented was to free the user from needing to check for null or error codes. — Miguel​

Re: [IMAGING] Logging vs Throwing exceptions

2023-05-10 Thread Gilles Sadowski
Le mer. 10 mai 2023 à 12:29, Gilles Sadowski a écrit : > > Hello. > > Le mar. 9 mai 2023 à 23:43, Gary D. Gregory a écrit : > > > > Hi All, > > > > The method > > org.apache.commons.imaging.icc.IccProfileParser.getICCProfileInfo(ByteSource) > > looks like: > > > > public IccProfileInfo getI

Re: [IMAGING] Logging vs Throwing exceptions

2023-05-10 Thread Gilles Sadowski
Hello. Le mar. 9 mai 2023 à 23:43, Gary D. Gregory a écrit : > > Hi All, > > The method > org.apache.commons.imaging.icc.IccProfileParser.getICCProfileInfo(ByteSource) > looks like: > > public IccProfileInfo getICCProfileInfo(final ByteSource byteSource) { > // TODO Throw instead of

[IMAGING] Logging vs Throwing exceptions

2023-05-09 Thread Gary D. Gregory
Hi All, The method org.apache.commons.imaging.icc.IccProfileParser.getICCProfileInfo(ByteSource) looks like: public IccProfileInfo getICCProfileInfo(final ByteSource byteSource) { // TODO Throw instead of logging? final IccProfileInfo result; try (InputStream is = by