Search in sources :

Example 1 with ErrorCode

use of org.eclipse.jetty.http2.ErrorCode in project jetty.project by eclipse.

the class HttpReceiverOverHTTP2 method onReset.

@Override
public void onReset(Stream stream, ResetFrame frame) {
    HttpExchange exchange = getHttpExchange();
    if (exchange == null)
        return;
    ErrorCode error = ErrorCode.from(frame.getError());
    String reason = error == null ? "reset" : error.name().toLowerCase(Locale.ENGLISH);
    exchange.getRequest().abort(new IOException(reason));
}
Also used : HttpExchange(org.eclipse.jetty.client.HttpExchange) ErrorCode(org.eclipse.jetty.http2.ErrorCode) IOException(java.io.IOException)

Example 2 with ErrorCode

use of org.eclipse.jetty.http2.ErrorCode in project jetty.project by eclipse.

the class ResetFrame method toString.

@Override
public String toString() {
    ErrorCode errorCode = ErrorCode.from(error);
    String reason = errorCode == null ? "error=" + error : errorCode.name().toLowerCase(Locale.ENGLISH);
    return String.format("%s#%d{%s}", super.toString(), streamId, reason);
}
Also used : ErrorCode(org.eclipse.jetty.http2.ErrorCode)

Aggregations

ErrorCode (org.eclipse.jetty.http2.ErrorCode)2 IOException (java.io.IOException)1 HttpExchange (org.eclipse.jetty.client.HttpExchange)1