Search in sources :

Example 1 with StreamException

use of com.webpieces.http2parser.api.dto.error.StreamException in project webpieces by deanhiller.

the class Level2ParsingAndRemoteSettings method handleError.

private Void handleError(Object object, Throwable e) {
    if (e == null)
        return null;
    else if (e instanceof ConnectionClosedException) {
        log.error("Normal exception since we are closing and they do not know yet", e);
    } else if (e instanceof StreamException) {
        log.error("shutting the stream down due to error", e);
        syncro.sendRstToServerAndApp((StreamException) e).exceptionally(t -> logExc("stream", t));
    } else if (e instanceof ConnectionException) {
        log.error("shutting the connection down due to error", e);
        ConnectionFailure reset = new ConnectionFailure((ConnectionException) e);
        //send GoAway
        syncro.sendGoAwayToSvrAndResetAllToApp(reset).exceptionally(t -> logExc("connection", t));
    } else {
        log.error("shutting the connection down due to error(MAKE sure your clients try..catch, exceptions)", e);
        ConnectionException exc = new ConnectionException(CancelReasonCode.BUG, logId, 0, e.getMessage(), e);
        ConnectionFailure reset = new ConnectionFailure((ConnectionException) exc);
        //send GoAwa
        syncro.sendGoAwayToSvrAndResetAllToApp(reset).exceptionally(t -> logExc("connection", t));
    }
    return null;
}
Also used : Http2Trailers(com.webpieces.hpack.api.dto.Http2Trailers) UnknownFrame(com.webpieces.http2parser.api.dto.UnknownFrame) ConnectionClosedException(com.webpieces.http2engine.api.ConnectionClosedException) Http2Config(com.webpieces.http2engine.api.client.Http2Config) CompletableFuture(java.util.concurrent.CompletableFuture) CancelReasonCode(com.webpieces.http2parser.api.dto.error.CancelReasonCode) Http2Msg(com.webpieces.http2parser.api.dto.lib.Http2Msg) HeaderSettings(com.webpieces.http2engine.impl.shared.data.HeaderSettings) SettingsFrame(com.webpieces.http2parser.api.dto.SettingsFrame) HpackParser(com.webpieces.hpack.api.HpackParser) UnmarshalState(com.webpieces.hpack.api.UnmarshalState) DataWrapper(org.webpieces.data.api.DataWrapper) StreamException(com.webpieces.http2parser.api.dto.error.StreamException) Logger(org.webpieces.util.logging.Logger) PriorityFrame(com.webpieces.http2parser.api.dto.PriorityFrame) ConnectionFailure(com.webpieces.http2engine.api.error.ConnectionFailure) PingFrame(com.webpieces.http2parser.api.dto.PingFrame) GoAwayFrame(com.webpieces.http2parser.api.dto.GoAwayFrame) List(java.util.List) ReceivedGoAway(com.webpieces.http2engine.api.error.ReceivedGoAway) RstStreamFrame(com.webpieces.http2parser.api.dto.RstStreamFrame) WindowUpdateFrame(com.webpieces.http2parser.api.dto.WindowUpdateFrame) ConnectionException(com.webpieces.http2parser.api.dto.error.ConnectionException) LoggerFactory(org.webpieces.util.logging.LoggerFactory) DataFrame(com.webpieces.http2parser.api.dto.DataFrame) ConnectionFailure(com.webpieces.http2engine.api.error.ConnectionFailure) ConnectionClosedException(com.webpieces.http2engine.api.ConnectionClosedException) ConnectionException(com.webpieces.http2parser.api.dto.error.ConnectionException) StreamException(com.webpieces.http2parser.api.dto.error.StreamException)

Aggregations

HpackParser (com.webpieces.hpack.api.HpackParser)1 UnmarshalState (com.webpieces.hpack.api.UnmarshalState)1 Http2Trailers (com.webpieces.hpack.api.dto.Http2Trailers)1 ConnectionClosedException (com.webpieces.http2engine.api.ConnectionClosedException)1 Http2Config (com.webpieces.http2engine.api.client.Http2Config)1 ConnectionFailure (com.webpieces.http2engine.api.error.ConnectionFailure)1 ReceivedGoAway (com.webpieces.http2engine.api.error.ReceivedGoAway)1 HeaderSettings (com.webpieces.http2engine.impl.shared.data.HeaderSettings)1 DataFrame (com.webpieces.http2parser.api.dto.DataFrame)1 GoAwayFrame (com.webpieces.http2parser.api.dto.GoAwayFrame)1 PingFrame (com.webpieces.http2parser.api.dto.PingFrame)1 PriorityFrame (com.webpieces.http2parser.api.dto.PriorityFrame)1 RstStreamFrame (com.webpieces.http2parser.api.dto.RstStreamFrame)1 SettingsFrame (com.webpieces.http2parser.api.dto.SettingsFrame)1 UnknownFrame (com.webpieces.http2parser.api.dto.UnknownFrame)1 WindowUpdateFrame (com.webpieces.http2parser.api.dto.WindowUpdateFrame)1 CancelReasonCode (com.webpieces.http2parser.api.dto.error.CancelReasonCode)1 ConnectionException (com.webpieces.http2parser.api.dto.error.ConnectionException)1 StreamException (com.webpieces.http2parser.api.dto.error.StreamException)1 Http2Msg (com.webpieces.http2parser.api.dto.lib.Http2Msg)1