How to use the phoenixdb.avatica.proto.responses_pb2.ErrorResponse function in phoenixdb

To help you get started, we’ve selected a few phoenixdb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apache / phoenix-queryserver / python-phoenixdb / phoenixdb / avatica / client.py View on Github external
def parse_error_protobuf(text):
    try:
        message = common_pb2.WireMessage()
        message.ParseFromString(text)

        err = responses_pb2.ErrorResponse()
        if not err.ParseFromString(message.wrapped_message):
            raise Exception('No error message found')
    except Exception:
        # Not a protobuf error, fall through
        return

    parse_and_raise_sql_error(err.error_message)
    raise_sql_error(err.error_code, err.sql_state, err.error_message)
    # Not a protobuf error, fall through
github lalinsky / python-phoenixdb / phoenixdb / avatica / client.py View on Github external
def parse_error_protobuf(text):
    message = common_pb2.WireMessage()
    message.ParseFromString(text)

    err = responses_pb2.ErrorResponse()
    err.ParseFromString(message.wrapped_message)

    parse_and_raise_sql_error(err.error_message)
    raise_sql_error(err.error_code, err.sql_state, err.error_message)
    raise errors.InternalError(err.error_message)
github apache / phoenix / python / phoenixdb / phoenixdb / avatica / client.py View on Github external
def parse_error_protobuf(text):
    message = common_pb2.WireMessage()
    message.ParseFromString(text)

    err = responses_pb2.ErrorResponse()
    err.ParseFromString(message.wrapped_message)

    parse_and_raise_sql_error(err.error_message)
    raise_sql_error(err.error_code, err.sql_state, err.error_message)
    raise errors.InternalError(err.error_message)