package okhttp3.internal.http2;

import g.h0.c.g;

/* JADX INFO: compiled from: ErrorCode.kt */
/* JADX INFO: loaded from: classes.dex */
public enum ErrorCode {
    NO_ERROR(0),
    PROTOCOL_ERROR(1),
    INTERNAL_ERROR(2),
    FLOW_CONTROL_ERROR(3),
    SETTINGS_TIMEOUT(4),
    STREAM_CLOSED(5),
    FRAME_SIZE_ERROR(6),
    REFUSED_STREAM(7),
    CANCEL(8),
    COMPRESSION_ERROR(9),
    CONNECT_ERROR(10),
    ENHANCE_YOUR_CALM(11),
    INADEQUATE_SECURITY(12),
    HTTP_1_1_REQUIRED(13);

    public static final Companion Companion = new Companion(null);
    private final int httpCode;

    /* JADX INFO: compiled from: ErrorCode.kt */
    public static final class Companion {
        private Companion() {
        }

        public final ErrorCode fromHttp2(int i2) {
            ErrorCode[] errorCodeArrValues = ErrorCode.values();
            for (int i3 = 0; i3 < 14; i3++) {
                ErrorCode errorCode = errorCodeArrValues[i3];
                if (errorCode.getHttpCode() == i2) {
                    return errorCode;
                }
            }
            return null;
        }

        public /* synthetic */ Companion(g gVar) {
            this();
        }
    }

    ErrorCode(int i2) {
        this.httpCode = i2;
    }

    public final int getHttpCode() {
        return this.httpCode;
    }
}
