public final class Exceptions
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T extends java.lang.Throwable> |
clearTrace(T exception)
Empties the stack trace of the specified
exception . |
static boolean |
isExpected(java.lang.Throwable cause)
Returns
true if the specified exception is expected to occur in well-known circumstances. |
static boolean |
isVerbose()
Returns whether the verbose mode is enabled.
|
static void |
logIfUnexpected(org.slf4j.Logger logger,
io.netty.channel.Channel ch,
SessionProtocol protocol,
java.lang.String debugData,
java.lang.Throwable cause)
Logs the specified exception if it is isExpected(Throwable) unexpected}.
|
static void |
logIfUnexpected(org.slf4j.Logger logger,
io.netty.channel.Channel ch,
SessionProtocol protocol,
java.lang.Throwable cause)
Logs the specified exception if it is isExpected(Throwable) unexpected}.
|
static void |
logIfUnexpected(org.slf4j.Logger logger,
io.netty.channel.Channel ch,
java.lang.String debugData,
java.lang.Throwable cause)
Logs the specified exception if it is isExpected(Throwable) unexpected}.
|
static void |
logIfUnexpected(org.slf4j.Logger logger,
io.netty.channel.Channel ch,
java.lang.Throwable cause)
Logs the specified exception if it is isExpected(Throwable) unexpected}.
|
static java.lang.String |
traceText(java.lang.Throwable exception)
Deprecated.
Use
Throwables.getStackTraceAsString(Throwable) . |
public static boolean isVerbose()
The verbose mode is disabled by default. Specify the
-Dcom.linecorp.armeria.verboseExceptions=true
JVM option to enable it.
public static void logIfUnexpected(org.slf4j.Logger logger, io.netty.channel.Channel ch, java.lang.Throwable cause)
public static void logIfUnexpected(org.slf4j.Logger logger, io.netty.channel.Channel ch, java.lang.String debugData, java.lang.Throwable cause)
public static void logIfUnexpected(org.slf4j.Logger logger, io.netty.channel.Channel ch, SessionProtocol protocol, java.lang.Throwable cause)
public static void logIfUnexpected(org.slf4j.Logger logger, io.netty.channel.Channel ch, SessionProtocol protocol, java.lang.String debugData, java.lang.Throwable cause)
public static boolean isExpected(java.lang.Throwable cause)
true
if the specified exception is expected to occur in well-known circumstances.
ClosedChannelException
ClosedSessionException
IOException
- 'Connection reset/closed/aborted by peer'Http2Exception
- 'Stream closed'public static <T extends java.lang.Throwable> T clearTrace(T exception)
exception
.@Deprecated public static java.lang.String traceText(java.lang.Throwable exception)
Throwables.getStackTraceAsString(Throwable)
.exception
as a String
instead.