Re: [compress] [Poll] Dealing with uncaught RuntimeExceptions

2021-06-30 Thread Torsten Curdt
> > "If there is runtime exception there is a bug in the code" > > I don't think that's correct because IllegalArgumentException is a > RuntimeException. I have a hard time following that causality. The way I've seen this exception used mainly is in case of program errors, not in case of input va

Re: [compress] [Poll] Dealing with uncaught RuntimeExceptions

2021-06-30 Thread Gary Gregory
"If there is runtime exception there is a bug in the code" I don't think that's correct because IllegalArgumentException is a RuntimeException. See https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html Gary On Wed, Jun 30, 2021, 16:50 Torsten Curdt wrote: > > > > It

Re: [compress] [Poll] Dealing with uncaught RuntimeExceptions

2021-06-30 Thread Torsten Curdt
> > It is not the job of commons-compress to stop you from using a > corrupt archive. If you choose to do so, then ... > I don't think that's what it is. That would be more like getting an exception and continuing walking through the archive. If there is a parse exception there is a bug in the in

Re: [compress] [Poll] Dealing with uncaught RuntimeExceptions

2021-06-30 Thread Oliver Heger
Am 30.06.21 um 14:41 schrieb Gary Gregory: On Tue, Jun 29, 2021 at 4:24 PM Stefan Bodewig wrote: Hi I'm sorry, but I'm unable to see what would or would not work for the people who chimed in. Short of calling for a vote, lets try with a poll that could show whether there is some sort of so

Re: [compress] [Poll] Dealing with uncaught RuntimeExceptions

2021-06-30 Thread Jochen Wiedmann
On Tue, Jun 29, 2021 at 10:24 PM Stefan Bodewig wrote: > (4) don't catch RuntimeExceptions at all, just document broken archives > can cause arbitrary RuntimeExceptions and code that tries to read > archives from untrusted sources is expected to deal with them > itself. Strongly in f

Re: [compress] [Poll] Dealing with uncaught RuntimeExceptions

2021-06-30 Thread Stefan Bodewig
On 2021-06-29, Stefan Bodewig wrote: > Options raised during the thread: > (1) catch all RuntimeExceptions, wrap them in an IOException (possibly a > subclass) and throw the IOException +1 > (2) catch only a subset of all RuntimeExceptions, wrap them in an > IOException (possibly a subc

Re: [compress] [Poll] Dealing with uncaught RuntimeExceptions

2021-06-30 Thread Gary Gregory
On Tue, Jun 29, 2021 at 4:24 PM Stefan Bodewig wrote: > > Hi > > I'm sorry, but I'm unable to see what would or would not work for the > people who chimed in. Short of calling for a vote, lets try with a poll > that could show whether there is some sort of solution that is > acceptable to everybod

Re: [compress] [Poll] Dealing with uncaught RuntimeExceptions

2021-06-30 Thread Gilles Sadowski
Le mer. 30 juin 2021 à 11:55, PeterLee a écrit : > > > (1) catch all RuntimeExceptions, wrap them in an IOException (possibly a > >subclass) and throw the IOException > > -1 > > I agree with sebb about this option - this may accidentally convert a bug > into > something else. > > > (2) catch o

Re: [compress] [Poll] Dealing with uncaught RuntimeExceptions

2021-06-30 Thread PeterLee
> (1) catch all RuntimeExceptions, wrap them in an IOException (possibly a >subclass) and throw the IOException -1 I agree with sebb about this option - this may accidentally convert a bug into something else. > (2) catch only a subset of all RuntimeExceptions, wrap them in an > IOExcept

Re: [compress] Dealing with uncaught RuntimeExceptions (again)

2021-06-30 Thread PeterLee
> So ideally Compress will return a CE for parsing errors, and that CE > should give some context to the error. > Care must be taken however not to catch every RTE, lest this hide a coding bug. +1 for this. Lee On Tue, Jun 29, 2021 at 7:57 PM sebb wrote: > On Tue, 29 Jun 2021 at 12:16, Gary Gr