Top Description Inners Fields Constructors Methods
io.netty5.handler.codec.http2

public Class Http2Exception

extends Exception
Class Inheritance
Known Direct Subclasses
io.netty5.handler.codec.http2.Http2Exception.ClosedStreamCreationException, io.netty5.handler.codec.http2.Http2Exception.StreamException, io.netty5.handler.codec.http2.Http2Exception.CompositeStreamException, io.netty5.handler.codec.http2.Http2Exception.StacklessHttp2Exception, io.netty5.handler.codec.http2.StreamBufferingEncoder.Http2ChannelClosedException, io.netty5.handler.codec.http2.StreamBufferingEncoder.Http2GoAwayException, io.netty5.handler.codec.http2.Http2NoMoreStreamIdsException
Annotations
@UnstableApi
Imports
io.netty5.util.internal.ThrowableUtil, .UnstableApi, java.util.ArrayList, .Arrays, .Iterator, .List

Exception thrown when an HTTP/2 error was encountered.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Http2Exception.ClosedStreamCreationException

Used when a stream creation attempt fails but may be because the stream was previously closed.

public static class
Http2Exception.CompositeStreamException

Provides the ability to handle multiple stream exceptions with one throw statement.

public static class
public static enum
Http2Exception.ShutdownHint

Provides a hint as to if shutdown is justified, what type of shutdown should be executed.

private static class
public static class
Http2Exception.StreamException

Represents an exception that can be isolated to a single stream (as opposed to the entire connection).

Field Summary

Modifier and TypeField and Description
private final Http2Error
private static final long
private final Http2Exception.ShutdownHint

Constructor Summary

AccessConstructor and Description
public
public
public
public
public
Http2Exception(Http2Error error, String message, Throwable cause)

public
private
Http2Exception(Http2Error error, String message, Http2Exception.ShutdownHint shutdownHint, boolean shared)

Method Summary

Modifier and TypeMethod and Description
public static Http2Exception

Returns:

An exception which can be translated into an HTTP/2 error.
closedStreamError
(Http2Error
The type of error as defined by the HTTP/2 specification.
error
,
String
String with the content and format for the additional debug data.
fmt
,
Object...
Objects which fit into the format defined by fmt.
args
)

Use if an error has occurred which can not be isolated to a single stream, but instead applies to the entire connection.

public static Http2Exception

Returns:

An exception which can be translated into an HTTP/2 error.
connectionError
(Http2Error
The type of error as defined by the HTTP/2 specification.
error
,
String
String with the content and format for the additional debug data.
fmt
,
Object...
Objects which fit into the format defined by fmt.
args
)

Use if an error has occurred which can not be isolated to a single stream, but instead applies to the entire connection.

public static Http2Exception

Returns:

An exception which can be translated into an HTTP/2 error.
connectionError
(Http2Error
The type of error as defined by the HTTP/2 specification.
error
,
Throwable
The object which caused the error.
cause
,
String
String with the content and format for the additional debug data.
fmt
,
Object...
Objects which fit into the format defined by fmt.
args
)

Use if an error has occurred which can not be isolated to a single stream, but instead applies to the entire connection.

public Http2Error
private static String
public static Http2Exception

Returns:

If the id is not Http2CodecUtil#CONNECTION_STREAM_ID then a HeaderListSizeException will be returned. Otherwise the error is considered a connection error and a Http2Exception is returned.
headerListSizeError
(int
The stream id for which the error is isolated to.
id
,
Http2Error
The type of error as defined by the HTTP/2 specification.
error
,
boolean
Whether this error was caught while decoding headers
onDecode
,
String
String with the content and format for the additional debug data.
fmt
,
Object...
Objects which fit into the format defined by fmt.
args
)

A specific stream error resulting from failing to decode headers that exceeds the max header size list.

public static boolean

Returns:

true if e is an instance of StreamException. false otherwise.
isStreamError
(Http2Exception
The exception to check.
e
)

Check if an exception is isolated to a single stream or the entire connection.

pack-priv static Http2Exception
newStatic(Http2Error error, String message, Http2Exception.ShutdownHint shutdownHint, Class<?> clazz, String method)

public Http2Exception.ShutdownHint
shutdownHint()

Provide a hint as to what type of shutdown should be executed.

public static Http2Exception

Returns:

If the id is not Http2CodecUtil#CONNECTION_STREAM_ID then a StreamException will be returned. Otherwise the error is considered a connection error and a Http2Exception is returned.
streamError
(int
The stream id for which the error is isolated to.
id
,
Http2Error
The type of error as defined by the HTTP/2 specification.
error
,
String
String with the content and format for the additional debug data.
fmt
,
Object...
Objects which fit into the format defined by fmt.
args
)

Use if an error which can be isolated to a single stream has occurred.

public static Http2Exception

Returns:

If the id is not Http2CodecUtil#CONNECTION_STREAM_ID then a StreamException will be returned. Otherwise the error is considered a connection error and a Http2Exception is returned.
streamError
(int
The stream id for which the error is isolated to.
id
,
Http2Error
The type of error as defined by the HTTP/2 specification.
error
,
Throwable
The object which caused the error.
cause
,
String
String with the content and format for the additional debug data.
fmt
,
Object...
Objects which fit into the format defined by fmt.
args
)

Use if an error which can be isolated to a single stream has occurred.

public static int

Returns:

Http2CodecUtil#CONNECTION_STREAM_ID if e is a connection error. Otherwise the stream id associated with the stream error.
streamId
(Http2Exception
The exception to get the stream id for.
e
)

Get the stream id associated with an exception.

Field Detail

errorback to summary
private final Http2Error error
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.Exception.serialVersionUID.

shutdownHintback to summary
private final Http2Exception.ShutdownHint shutdownHint

Constructor Detail

Http2Exceptionback to summary
public Http2Exception(Http2Error error)
Http2Exceptionback to summary
public Http2Exception(Http2Error error, Http2Exception.ShutdownHint shutdownHint)
Http2Exceptionback to summary
public Http2Exception(Http2Error error, String message)
Http2Exceptionback to summary
public Http2Exception(Http2Error error, String message, Http2Exception.ShutdownHint shutdownHint)
Http2Exceptionback to summary
public Http2Exception(Http2Error error, String message, Throwable cause)
Http2Exceptionback to summary
public Http2Exception(Http2Error error, String message, Throwable cause, Http2Exception.ShutdownHint shutdownHint)
Http2Exceptionback to summary
private Http2Exception(Http2Error error, String message, Http2Exception.ShutdownHint shutdownHint, boolean shared)

Method Detail

closedStreamErrorback to summary
public static Http2Exception closedStreamError(Http2Error error, String fmt, Object... args)

Use if an error has occurred which can not be isolated to a single stream, but instead applies to the entire connection.

Parameters
error:Http2Error

The type of error as defined by the HTTP/2 specification.

fmt:String

String with the content and format for the additional debug data.

args:Object[]

Objects which fit into the format defined by fmt.

Returns:Http2Exception

An exception which can be translated into an HTTP/2 error.

connectionErrorback to summary
public static Http2Exception connectionError(Http2Error error, String fmt, Object... args)

Use if an error has occurred which can not be isolated to a single stream, but instead applies to the entire connection.

Parameters
error:Http2Error

The type of error as defined by the HTTP/2 specification.

fmt:String

String with the content and format for the additional debug data.

args:Object[]

Objects which fit into the format defined by fmt.

Returns:Http2Exception

An exception which can be translated into an HTTP/2 error.

connectionErrorback to summary
public static Http2Exception connectionError(Http2Error error, Throwable cause, String fmt, Object... args)

Use if an error has occurred which can not be isolated to a single stream, but instead applies to the entire connection.

Parameters
error:Http2Error

The type of error as defined by the HTTP/2 specification.

cause:Throwable

The object which caused the error.

fmt:String

String with the content and format for the additional debug data.

args:Object[]

Objects which fit into the format defined by fmt.

Returns:Http2Exception

An exception which can be translated into an HTTP/2 error.

errorback to summary
public Http2Error error()
formatErrorMessageback to summary
private static String formatErrorMessage(String fmt, Object[] args)
headerListSizeErrorback to summary
public static Http2Exception headerListSizeError(int id, Http2Error error, boolean onDecode, String fmt, Object... args)

A specific stream error resulting from failing to decode headers that exceeds the max header size list. If the id is not Http2CodecUtil#CONNECTION_STREAM_ID then a StreamException will be returned. Otherwise the error is considered a connection error and a Http2Exception is returned.

Parameters
id:int

The stream id for which the error is isolated to.

error:Http2Error

The type of error as defined by the HTTP/2 specification.

onDecode:boolean

Whether this error was caught while decoding headers

fmt:String

String with the content and format for the additional debug data.

args:Object[]

Objects which fit into the format defined by fmt.

Returns:Http2Exception

If the id is not Http2CodecUtil#CONNECTION_STREAM_ID then a HeaderListSizeException will be returned. Otherwise the error is considered a connection error and a Http2Exception is returned.

isStreamErrorback to summary
public static boolean isStreamError(Http2Exception e)

Check if an exception is isolated to a single stream or the entire connection.

Parameters
e:Http2Exception

The exception to check.

Returns:boolean

true if e is an instance of StreamException. false otherwise.

newStaticback to summary
pack-priv static Http2Exception newStatic(Http2Error error, String message, Http2Exception.ShutdownHint shutdownHint, Class<?> clazz, String method)
shutdownHintback to summary
public Http2Exception.ShutdownHint shutdownHint()

Provide a hint as to what type of shutdown should be executed. Note this hint may be ignored.

streamErrorback to summary
public static Http2Exception streamError(int id, Http2Error error, String fmt, Object... args)

Use if an error which can be isolated to a single stream has occurred. If the id is not Http2CodecUtil#CONNECTION_STREAM_ID then a StreamException will be returned. Otherwise the error is considered a connection error and a Http2Exception is returned.

Parameters
id:int

The stream id for which the error is isolated to.

error:Http2Error

The type of error as defined by the HTTP/2 specification.

fmt:String

String with the content and format for the additional debug data.

args:Object[]

Objects which fit into the format defined by fmt.

Returns:Http2Exception

If the id is not Http2CodecUtil#CONNECTION_STREAM_ID then a StreamException will be returned. Otherwise the error is considered a connection error and a Http2Exception is returned.

streamErrorback to summary
public static Http2Exception streamError(int id, Http2Error error, Throwable cause, String fmt, Object... args)

Use if an error which can be isolated to a single stream has occurred. If the id is not Http2CodecUtil#CONNECTION_STREAM_ID then a StreamException will be returned. Otherwise the error is considered a connection error and a Http2Exception is returned.

Parameters
id:int

The stream id for which the error is isolated to.

error:Http2Error

The type of error as defined by the HTTP/2 specification.

cause:Throwable

The object which caused the error.

fmt:String

String with the content and format for the additional debug data.

args:Object[]

Objects which fit into the format defined by fmt.

Returns:Http2Exception

If the id is not Http2CodecUtil#CONNECTION_STREAM_ID then a StreamException will be returned. Otherwise the error is considered a connection error and a Http2Exception is returned.

streamIdback to summary
public static int streamId(Http2Exception e)

Get the stream id associated with an exception.

Parameters
e:Http2Exception

The exception to get the stream id for.

Returns:int

Http2CodecUtil#CONNECTION_STREAM_ID if e is a connection error. Otherwise the stream id associated with the stream error.

io.netty5.handler.codec.http2 back to summary

public final Class Http2Exception.ClosedStreamCreationException

extends Http2Exception
Class Inheritance

Used when a stream creation attempt fails but may be because the stream was previously closed.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Inherited from io.netty5.handler.codec.http2.Http2Exception:
closedStreamErrorconnectionErrorconnectionErrorerrorheaderListSizeErrorisStreamErrornewStaticshutdownHintstreamErrorstreamErrorstreamId

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides io.netty5.handler.codec.http2.Http2Exception.serialVersionUID.

Constructor Detail

ClosedStreamCreationExceptionback to summary
public ClosedStreamCreationException(Http2Error error)
ClosedStreamCreationExceptionback to summary
public ClosedStreamCreationException(Http2Error error, String message)
ClosedStreamCreationExceptionback to summary
public ClosedStreamCreationException(Http2Error error, String message, Throwable cause)
io.netty5.handler.codec.http2 back to summary

public final Class Http2Exception.CompositeStreamException

extends Http2Exception
implements Iterable<Http2Exception.StreamException>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable

Provides the ability to handle multiple stream exceptions with one throw statement.

Field Summary

Modifier and TypeField and Description
private final List<Http2Exception.StreamException>
private static final long

Constructor Summary

AccessConstructor and Description
public
CompositeStreamException(Http2Error error, int initialCapacity)

Method Summary

Modifier and TypeMethod and Description
public void
public Iterator<Http2Exception.StreamException>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
Inherited from io.netty5.handler.codec.http2.Http2Exception:
closedStreamErrorconnectionErrorconnectionErrorerrorheaderListSizeErrorisStreamErrornewStaticshutdownHintstreamErrorstreamErrorstreamId

Field Detail

exceptionsback to summary
private final List<Http2Exception.StreamException> exceptions
serialVersionUIDback to summary
private static final long serialVersionUID

Hides io.netty5.handler.codec.http2.Http2Exception.serialVersionUID.

Constructor Detail

CompositeStreamExceptionback to summary
public CompositeStreamException(Http2Error error, int initialCapacity)

Method Detail

addback to summary
public void add(Http2Exception.StreamException e)
iteratorback to summary
public Iterator<Http2Exception.StreamException> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<Http2Exception.StreamException>

an Iterator.

Annotations
@Override
io.netty5.handler.codec.http2 back to summary

public final Class Http2Exception.HeaderListSizeException

extends StreamException
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final boolean
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv
HeaderListSizeException(int streamId, Http2Error error, String message, boolean decode)

Method Summary

Modifier and TypeMethod and Description
public boolean
Inherited from io.netty5.handler.codec.http2.Http2Exception.StreamException:
streamId

Field Detail

decodeback to summary
private final boolean decode
serialVersionUIDback to summary
private static final long serialVersionUID

Hides io.netty5.handler.codec.http2.Http2Exception.StreamException.serialVersionUID.

Constructor Detail

HeaderListSizeExceptionback to summary
pack-priv HeaderListSizeException(int streamId, Http2Error error, String message, boolean decode)

Method Detail

duringDecodeback to summary
public boolean duringDecode()
io.netty5.handler.codec.http2 back to summary

public final Enum Http2Exception.ShutdownHint

extends Enum<Http2Exception.ShutdownHint>
Class Inheritance

Provides a hint as to if shutdown is justified, what type of shutdown should be executed.

Field Summary

Modifier and TypeField and Description
public static final Http2Exception.ShutdownHint
GRACEFUL_SHUTDOWN

Attempt to execute a "graceful" shutdown.

public static final Http2Exception.ShutdownHint
HARD_SHUTDOWN

Close the channel immediately after a GOAWAY is sent.

public static final Http2Exception.ShutdownHint
NO_SHUTDOWN

Do not shutdown the underlying channel.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Http2Exception.ShutdownHint
public static Http2Exception.ShutdownHint[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

GRACEFUL_SHUTDOWNback to summary
public static final Http2Exception.ShutdownHint GRACEFUL_SHUTDOWN

Attempt to execute a "graceful" shutdown. The definition of "graceful" is left to the implementation. An example of "graceful" would be wait for some amount of time until all active streams are closed.

HARD_SHUTDOWNback to summary
public static final Http2Exception.ShutdownHint HARD_SHUTDOWN

Close the channel immediately after a GOAWAY is sent.

NO_SHUTDOWNback to summary
public static final Http2Exception.ShutdownHint NO_SHUTDOWN

Do not shutdown the underlying channel.

Constructor Detail

ShutdownHintback to summary
private ShutdownHint()

Method Detail

valueOfback to summary
public static Http2Exception.ShutdownHint valueOf(String name)
valuesback to summary
public static Http2Exception.ShutdownHint[] values()
io.netty5.handler.codec.http2 back to summary

private final Class Http2Exception.StacklessHttp2Exception

extends Http2Exception
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Throwable
fillInStackTrace()

Overrides java.lang.Throwable.fillInStackTrace.

Fills in the execution stack trace.
Inherited from io.netty5.handler.codec.http2.Http2Exception:
closedStreamErrorconnectionErrorconnectionErrorerrorheaderListSizeErrorisStreamErrornewStaticshutdownHintstreamErrorstreamErrorstreamId

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides io.netty5.handler.codec.http2.Http2Exception.serialVersionUID.

Constructor Detail

StacklessHttp2Exceptionback to summary
pack-priv StacklessHttp2Exception(Http2Error error, String message, Http2Exception.ShutdownHint shutdownHint)

Method Detail

fillInStackTraceback to summary
public Throwable fillInStackTrace()

Overrides java.lang.Throwable.fillInStackTrace.

Doc from java.lang.Throwable.fillInStackTrace.

Fills in the execution stack trace. This method records within this Throwable object information about the current state of the stack frames for the current thread.

If the stack trace of this Throwable is not writable, calling this method has no effect.

Returns:Throwable

a reference to this Throwable instance.

Annotations
@Override
io.netty5.handler.codec.http2 back to summary

public Class Http2Exception.StreamException

extends Http2Exception
Class Inheritance
Known Direct Subclasses
io.netty5.handler.codec.http2.Http2Exception.HeaderListSizeException

Represents an exception that can be isolated to a single stream (as opposed to the entire connection).

Field Summary

Modifier and TypeField and Description
private static final long
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
StreamException(int streamId, Http2Error error, String message)

pack-priv
StreamException(int streamId, Http2Error error, String message, Throwable cause)

Method Summary

Modifier and TypeMethod and Description
public int
Inherited from io.netty5.handler.codec.http2.Http2Exception:
closedStreamErrorconnectionErrorconnectionErrorerrorheaderListSizeErrorisStreamErrornewStaticshutdownHintstreamErrorstreamErrorstreamId

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides io.netty5.handler.codec.http2.Http2Exception.serialVersionUID.

streamIdback to summary
private final int streamId

Constructor Detail

StreamExceptionback to summary
pack-priv StreamException(int streamId, Http2Error error, String message)
StreamExceptionback to summary
pack-priv StreamException(int streamId, Http2Error error, String message, Throwable cause)

Method Detail

streamIdback to summary
public int streamId()