Package org.apache.tika.exception
Class TikaTimeoutException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.tika.exception.TikaException
org.apache.tika.exception.TikaTimeoutException
- All Implemented Interfaces:
Serializable
Thrown when a single operation (external process, HTTP call, pool borrow, etc.)
exceeds its allotted timeout.
Checked, not a RuntimeException: expected to be caught at the nearest
embedded-document boundary (see ParsingEmbeddedDocumentExtractor), recorded,
and parsing of remaining siblings continued. This differs from the task's total
deadline being exhausted, which does not throw at all -- see ParseRecord's
taskDeadlineReached handling.
When the caller got its budget via ParseTimeout.budgetFor(long), use
TikaTimeoutException(String, long, long) so the message states both the
requested and granted budget: granted == requested means the operation's own
timeout was binding; granted < requested means the task's total timeout was
binding and raising the operation's timeout won't help.
- Since:
- Apache Tika 4.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTikaTimeoutException(String message) TikaTimeoutException(String message, long requestedMillis, long grantedMillis) -
Method Summary
Modifier and TypeMethodDescriptionlonglongbooleanMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TikaTimeoutException
-
TikaTimeoutException
- Parameters:
requestedMillis- the timeout the caller's own configuration asked forgrantedMillis- the budget actually granted, e.g. byParseTimeout.budgetFor
-
-
Method Details
-
getRequestedMillis
public long getRequestedMillis()- Returns:
- the timeout the caller's own configuration requested, or
-1if this exception was not constructed with that information
-
getGrantedMillis
public long getGrantedMillis()- Returns:
- the budget actually granted, or
-1if this exception was not constructed with that information
-
isClippedByRemaining
public boolean isClippedByRemaining()- Returns:
- true if the granted budget was clipped below the requested timeout by the task's remaining time (the task's total timeout was binding, not the operation's own). False -- including when no requested/granted info was recorded -- means the operation's own timeout was binding.
-