mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-01 00:15:30 +08:00
22 lines
398 B
Python
22 lines
398 B
Python
from enum import IntEnum
|
|
|
|
|
|
class Status(IntEnum):
|
|
|
|
def __new__(cls, code, message=''):
|
|
obj = int.__new__(cls, code)
|
|
obj._code_ = code
|
|
|
|
obj.message = message
|
|
return obj
|
|
|
|
def __str__(self):
|
|
return str(self.code)
|
|
|
|
# success
|
|
OK = 200, 'OK'
|
|
|
|
INVALID = 300, 'Invalid'
|
|
UNKNOWN = 400, 'Unknown error'
|
|
NOT_SUPPORTED = 500, 'Not supported'
|