You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by Tilman Hausherr <TH...@t-online.de> on 2018/06/26 16:28:46 UTC

closeAndLogException usage in PDDocument

I had a look at IOUtils.closeAndLogException() and PDDocument.close() 
and if initialException is not null, then null is returned if a new 
exception is thrown, or if everything goes well. This means that at the 
end of PDDocument.close(), no exception would be thrown, right? Was this 
intended?

https://issues.apache.org/jira/browse/PDFBOX-4158

Tilman


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org


Re: closeAndLogException usage in PDDocument

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
that's a mistake. It should retain the first non null exception if there is any so instead of

return null;

it should be

return initialException;

in  IOUtils.closeAndLogException().

I'll open a ticket later today.
Maruan

 
> I had a look at IOUtils.closeAndLogException() and PDDocument.close() 
> and if initialException is not null, then null is returned if a new 
> exception is thrown, or if everything goes well. This means that at the 
> end of PDDocument.close(), no exception would be thrown, right? Was this 
> intended?
> 
> https://issues.apache.org/jira/browse/PDFBOX-4158
> 
> Tilman
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: dev-help@pdfbox.apache.org
> 
-- 
Maruan Sahyoun

FileAffairs GmbH
Josef-Schappe-Straße 21
40882 Ratingen

Tel: +49 (2102) 89497 88
Fax: +49 (2102) 89497 91
sahyoun@fileaffairs.de
www.fileaffairs.de

Geschäftsführer: Maruan Sahyoun
Handelsregister: AG Düsseldorf, HRB 53837
UST.-ID: DE248275827

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org