public static TApplicationException read(TProtocol iprot) throws TException {
        TField field;
        iprot.readStructBegin();

        String message = null;
        int type = TApplicationException.UNKNOWN;

        while (true) {
            field = iprot.readFieldBegin();
            if (field.type == TType.STOP) {
                break;
            }
            switch (field.id) {
                case 1:
                    if (field.type == TType.STRING) {
                        message = iprot.readString();
                    } else {
                        TProtocolUtil.skip(iprot, field.type);
                    }
                    break;
                case 2:
                    if (field.type == TType.I32) {
                        type = iprot.readI32();
                    } else {
                        TProtocolUtil.skip(iprot, field.type);
                    }
                    break;
                default:
                    TProtocolUtil.skip(iprot, field.type);
                    break;
            }
            iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        return new TApplicationException(type, message);
    }
Reads a {@link TApplicationException} from the specified {@link TProtocol}.

<p>Note: This has been copied from {@link TApplicationException#read(TProtocol)} due to API differences
between libthrift 0.9.x and 0.10.x.
thrift/thrift0.13/src/main/java/com/linecorp/armeria/internal/common/thrift/TApplicationExceptions.java