incubator-odf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremias Maerki <...@jeremias-maerki.ch>
Subject Re: OdfPackage not throwing an exception on I/O errors
Date Fri, 23 Mar 2012 09:07:51 GMT
On 22.03.2012 20:45:22 Rob Weir wrote:
> On Thu, Mar 22, 2012 at 1:34 PM, Jeremias Maerki <dev@jeremias-maerki.ch> wrote:
> > Hey guys,
> > is there a special reason why OdfPackage.save(OutputStream, String)
> > catches all IOExceptions, logs them and just continues? While I can see
> > the problems in the logs, my code thinks everything is fine and
> > continues normally.
> >
> 
> I can't think of a good reason.
> 
> > Furthermore, the public save() methods all throw Exception which is
> > rather bad style.
> >
> 
> I assume you mean that they should limit themselves to IOException?

That's the primary one, but if there are other important exceptions
where it doesn't make sense to turn them into IOExceptions, the they
should be added, too. Of course, large throws lists are not ideal. At
some point it makes sense to wrap them in a general OdfException. But
let me take a closer look first. I can then tell what comes up.

> > Can we please change that? I'll offer to write a proposal in form of a
> > patch.
> >
> 
> If you can contribute a patch, that would be great.  But please do a
> complete rebuild, to make sure the unit tests still work.
> 
> So from the top directory:
> 
> mvn clean install -Ppedantic

Will do.

> Thanks!
> 
> -Rob
> 
> 
> > Thanks,
> > Jeremias Maerki
> >




Jeremias Maerki


Mime
View raw message