from enum import Enum, unique # 异常枚举 @unique class ExceptionType(Enum): VIDEO_UPDATE_EXCEPTION = ("SP000", "Video upload exception!") OR_VIDEO_ADDRESS_EXCEPTION = ("SP001", "Original Video Address Error!") ANALYSE_TIMEOUT_EXCEPTION = ("SP002", "Analysis Timeout Exception!") PULLSTREAM_TIMEOUT_EXCEPTION = ("SP003", "Pull Stream Timeout Exception!") READSTREAM_TIMEOUT_EXCEPTION = ("SP004", "READ Stream Timeout Exception!") GET_VIDEO_URL_EXCEPTION = ("SP005", "Get Video Url Exception!") GET_VIDEO_URL_TIMEOUT_EXCEPTION = ("SP006", "Get Video Url Timeout Exception!") PULL_STREAM_URL_EXCEPTION = ("SP007", "Pull Stream Address Is Empty!") PULL_PIPELINE_INIT_EXCEPTION = ("SP008", "Pull Stream PIPELINE Exception!") PUSH_STREAM_URL_EXCEPTION = ("SP009", "Push Stream Address Is Empty!") CV2_IS_NULL_EXCEPTION = ("SP010", "The CV2 Is Empty!") OR_WRITE_OBJECT_EXCEPTION = ("SP011", "The Original Video Writing Object Is Empty!") AI_WRITE_OBJECT_EXCEPTION = ("SP012", "The Ai Video Writing Object Is Empty!") VIDEO_ADDRESS_EXCEPTION = ("SP013", "The Video Address Does Not Exist!") AI_VIDEO_ADDRESS_EXCEPTION = ("SP014", "AI Video Address Error!") OFFLINE_RETRY_TIMEOUT_EXCEPTION = ("SP015", "Offline Retry Timeout Exception!") AI_MODEL_CONFIG_EXCEPTION = ("SP016", "AI Model Config Exception!") AI_MODEL_MATCH_EXCEPTION = ("SP017", "The AI Model Is Not Matched!") VIDEO_MERGE_EXCEPTION = ("SP018", "The Video Merge Exception!") VIDEO_ANALYSIS_EXCEPTION = ("SP019", "Video Analysis Failed!") PUSH_STREAM_URL_E_EXCEPTION = ("SP020", "Push Stream URL Exception!") VIDEO_CONFIG_EXCEPTION = ("SP021", "Video Config Exception!") ILLEGAL_PARAMETER_FORMAT = ("SP022", "Illegal Parameter Format!") REQUEST_TYPE_NOT_MATCHED = ("SP023", "Request Type Not Matched!") MODEL_ANALYSIS_EXCEPTION = ("SP024", "Model Analysis Exception!") PUSH_STREAMING_CHANNEL_IS_OCCUPIED = ("SP025", "推流通道被占用, 请稍后再试!") WRITE_STREAM_EXCEPTION = ("SP026", "视频写流异常, 请联系工程师定位处理!") VIDEO_RESOLUTION_EXCEPTION = ("SP027", "不支持该分辨率类型的视频,请切换分辨率再试!") NO_GPU_RESOURCES = ("SP998", "暂无GPU资源可以使用,请稍后再试!") SERVICE_INNER_EXCEPTION = ("SP999", "系统内部异常, 请联系工程师定位处理!")