class KareErrors(Exception):
    SUCCESS = 0
    PERMISSION_DENIED = (1, "存储路径无权限")
    INSUFFICIENT_SPACE = (2, "存储空间不足")
    NETWORK_ERROR = (3, "网络异常")
    UNSUPPORTED_ARCH = (4, "不支持的架构")
    ALREADY_EXISTS = (5, "基础环境已存在")
    BUILD_INSTALL_ERROR = (6, "网络异常，构建失败")

    RELEASE_NOT_EXIST = (7, "基础环境不存在")
    PACKAGE_NOT_EXIST = (8, "安装包不存在")
    PACKAGE_ALREADY_EXISTS = (9, "安装包已安装在其他基础环境")
    CONTAINER_NOT_INSTALL = (10, "容器未安装")
    PACKAGE_UNPACK_FAIL = (11, "包解压失败")
    PACKAGE_DPKG_EXISTS = (12, "DPKG安装应用包")

    PACKAGE_NOT_INSTALL = (13, "应用未安装")
    SINGLE_ERROR = (14, "安装、卸载过程中，请勿重复执行")
    UNSUPPORTED_RELEASE = (15, "不支持的系统版本")
    PACKAGE_INSTALL_FAIL = (16, "安装失败")
    KYSEC_REJECT_INSTALL = (17, "Kysec禁止安装")
    KYSEC_REJECT_REMOVE = (18, "Kysec禁止卸载")
    
    ARGS_ERROR = (19, "import需要两个参数release和release.tar.gz路径")
    TAR_NOT_FOUND_ERROR = (20, "压缩包不存在")

    RELEASE_CONFIG_NOT_EXIST = (21, "基础环境配置文件不存在")


    error_code = {
        0: "成功",
        1: "存储路径无权限",
        2: "存储空间不足",
        3: "网络异常",
        4: "不支持的架构",
        5: "基础环境已存在",
        6: "网络异常，构建失败",
        7: "基础环境不存在",
        8: "安装包不存在",
        9: "安装包已安装在其他基础环境",
        10: "容器未安装",
        11: "包解压失败",
        12: "DPKG安装应用包",
        13: "应用未安装",
        14: "安装、卸载过程中，请勿重复执行",
        15: "不支持的系统版本",
        16: "安装失败",
        17: "Kysec禁止安装",
        18: "Kysec禁止卸载"
    }

    def __init__(self, *args):
        super().__init__(*args)