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;
}
Aggregations