You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Aaron Weber (Jira)" <ji...@apache.org> on 2021/04/15 20:56:00 UTC

[jira] [Comment Edited] (TIKA-3263) WriteLimitReachedException is not public

    [ https://issues.apache.org/jira/browse/TIKA-3263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17322479#comment-17322479 ] 

Aaron Weber edited comment on TIKA-3263 at 4/15/21, 8:55 PM:
-------------------------------------------------------------

Just ran into this as well.  Being able to catch the exception would suffice, I think.

As a workaround, do we catch SAXException, check the message text for "WriteLimitReachedException" and handle it or throw it on?

EDIT: Not caught via SAXException...is there a reasonable [public] Exception-class this is extended from to catch?


was (Author: aweber1nj):
Just ran into this as well.  Being able to catch the exception would suffice, I think.

As a workaround, do we catch SAXException, check the message text for "WriteLimitReachedException" and handle it or throw it on?

> WriteLimitReachedException is not public
> ----------------------------------------
>
>                 Key: TIKA-3263
>                 URL: https://issues.apache.org/jira/browse/TIKA-3263
>             Project: Tika
>          Issue Type: Improvement
>         Environment: Windows 10
>            Reporter: Peter Kronenberg
>            Priority: Minor
>
> I got a WriteLimitReachedException because my file was too big.  The message tells me that the text up the limit is still available.  However, it’s tricky to get that text and at the same time, respond appropriately to SAXExceptions.  Originally, my method was catching SAXEXceptions and assume there was an error.
> What I really want to do it to be able to catch WriteLimitReachedException, but still throw other SAXExceptions, which would indicate that something else went wrong.  But since WriteLimitReachedException is private, I can’t do that.
>  
> Here’s what my code originally looked like:
> !Code1.png!
> But this didn’t work, because if I get a WriteLimitReachedException, it doesn’t tell me what data that it got
>  
>  Given this new knowledge, here’s what I want to do, but I can't, because WriteLimitReachedException is private.  There's no reason for it to be private.
>  
>   !Code2.png!
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)