Package org.apache.tika.utils
Class ExceptionUtils
java.lang.Object
org.apache.tika.utils.ExceptionUtils
Turns a
Throwable into the string Tika reports to callers, under the
ExceptionReporting policy in effect. Tika's own channels record and emit exception
text through format(Throwable, ParseContext) so that one config setting governs
them all; exception text produced by third-party libraries is outside its reach.
NOTE: If your stacktraces are truncated, make sure to start your jvm with: -XX:-OmitStackTraceInFastThrow
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringformat(Throwable t, ExceptionReporting reporting) Formatstfor channels that have no ParseContext, such as server error responses and pipes crash messages.static Stringformat(Throwable t, ParseContext context) Formatstunder theExceptionReportingfound incontext(or the default policy if the context is null or has none).static StringDeprecated.static StringDeprecated.since 4.1, removal planned for 5.0; useformat(Throwable, ParseContext)so the configured policy appliesstatic StringTruncatessto the policy'sExceptionReporting.getMaxLength()(no-op when unlimited), for channels that report exception text they did not format themselves.
-
Constructor Details
-
ExceptionUtils
public ExceptionUtils()
-
-
Method Details
-
format
Formatstunder theExceptionReportingfound incontext(or the default policy if the context is null or has none). -
format
Formatstfor channels that have no ParseContext, such as server error responses and pipes crash messages. -
getFilteredStackTrace
Deprecated.since 4.1, removal planned for 5.0; useformat(Throwable, ParseContext)so the configured policy applies. Unlike this method, it keeps a bareTikaExceptionwrapper. -
getStackTrace
Deprecated.since 4.1, removal planned for 5.0; useformat(Throwable, ParseContext)so the configured policy applies -
truncate
Truncatessto the policy'sExceptionReporting.getMaxLength()(no-op when unlimited), for channels that report exception text they did not format themselves.
-
format(Throwable, ParseContext)so the configured policy applies.