2021-06-07 15:21:36 +08:00
|
|
|
from enum import Enum
|
2021-08-20 11:00:56 +08:00
|
|
|
from pymilvus import ExceptionsMessage
|
2021-06-07 15:21:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
class ErrorCode(Enum):
|
|
|
|
ErrorOk = 0
|
|
|
|
Error = 1
|
|
|
|
|
|
|
|
|
|
|
|
ErrorMessage = {ErrorCode.ErrorOk: "",
|
|
|
|
ErrorCode.Error: "is illegal"}
|
2021-06-23 20:22:08 +08:00
|
|
|
|
|
|
|
|
2021-06-28 15:54:11 +08:00
|
|
|
class ErrorMap:
|
|
|
|
def __init__(self, err_code, err_msg):
|
|
|
|
self.err_code = err_code
|
|
|
|
self.err_msg = err_msg
|
|
|
|
|
|
|
|
|
2021-06-25 10:46:09 +08:00
|
|
|
class ConnectionErrorMessage(ExceptionsMessage):
|
2021-06-23 20:22:08 +08:00
|
|
|
FailConnect = "Fail connecting to server on %s:%s. Timeout"
|
|
|
|
ConnectExist = "The connection named %s already creating, but passed parameters don't match the configured parameters"
|
2021-06-28 15:54:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
class CollectionErrorMessage(ExceptionsMessage):
|
|
|
|
CollNotLoaded = "collection %s was not loaded into memory"
|
2021-07-15 15:03:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
class PartitionErrorMessage(ExceptionsMessage):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class IndexErrorMessage(ExceptionsMessage):
|
|
|
|
WrongFieldName = "%s has type %s, but expected one of: bytes, unicode"
|