# coding=utf-8
# -------------------------------------------------------------------------
#  This file is part of the MindStudio project.
# Copyright (c) 2025 Huawei Technologies Co.,Ltd.
#
# MindStudio is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#
#          http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# -------------------------------------------------------------------------

"""
Function:
This file mainly involves the CompareError function.
"""


class CompareError(Exception):
    """
    The class for compare error
    """
    MSACCUCMP_NONE_ERROR = 0
    MSACCUCMP_UNKNOWN_ERROR = 1
    MSACCUCMP_NO_DUMP_FILE_ERROR = 2
    MSACCUCMP_INVALID_PATH_ERROR = 3
    MSACCUCMP_PARSE_DUMP_FILE_ERROR = 4
    MSACCUCMP_MALLOC_ERROR = 5
    MSACCUCMP_INVALID_PARAM_ERROR = 6
    MSACCUCMP_OPEN_FILE_ERROR = 7
    MSACCUCMP_CLOSE_FILE_ERROR = 8
    MSACCUCMP_OPEN_DIR_ERROR = 9
    MSACCUCMP_CLOSE_DIR_ERROR = 10
    MSACCUCMP_INVALID_DUMP_DATA_ERROR = 11
    MSACCUCMP_INDEX_OUT_OF_BOUNDS_ERROR = 12
    MSACCUCMP_PARSER_JSON_FILE_ERROR = 13
    MSACCUCMP_MEMSET_ERROR = 14
    MSACCUCMP_LEFT_DUMP_ZERO_ERROR = 15
    MSACCUCMP_RIGHT_DUMP_ZERO_ERROR = 16
    MSACCUCMP_MATCH_MORE_FILE_ERROR = 17
    MSACCUCMP_DUMP_FILE_ERROR = 18
    MSACCUCMP_WRITE_FILE_ERROR = 19
    MSACCUCMP_INVALID_DUMP_TYPE_ERROR = 20
    MSACCUCMP_INVALID_DATA_TYPE_ERROR = 21
    MSACCUCMP_INVALID_FORMAT_ERROR = 22
    MSACCUCMP_INVALID_SHAPE_ERROR = 23
    MSACCUCMP_INVALID_TYPE_ERROR = 24
    MSACCUCMP_INVALID_TARGET_ERROR = 25
    MSACCUCMP_INVALID_CONVERT_FUNC_ERROR = 26
    MSACCUCMP_SHAPE_CONVERT_ERROR = 27
    MSACCUCMP_INVALID_GOLDEN_EVN_ERROR = 28
    MSACCUCMP_INVALID_JSON_FILE_ERROR = 29
    MSACCUCMP_UNSUPPORTED_COMPARE_ERROR = 30
    MSACCUCMP_INVALID_ALGORITHM_ERROR = 31
    MSACCUCMP_DELETE_FILE_ERROR = 32
    MSACCUCMP_INVALID_FILE_ERROR = 33
    MSACCUCMP_INVALID_FRACTAL_NZ_DUMP_DATA_ERROR = 34
    MSACCUCMP_INVALID_OVERFLOW_TYPE_ERROR = 35
    MSACCUCMP_INVALID_OVERFLOW_STATUS_ERROR = 36
    MSACCUCMP_INVALID_TASK_TYPE = 37
    MSACCUCMP_MISSING_FILE = 38
    MSACCUCMP_UNMATCH_STANDARD_DUMP_SIZE = 39
    MSACCUCMP_UNMATCH_DATA_SHAPE_ERROR = 40
    MSACCUCMP_INVALID_SLICE_DATA = 41
    MSACCUCMP_INVALID_INPUT_MAPPING = 42
    MSACCUCMP_FILE_TOO_LARGE_ERROR = 43
    MSACCUCMP_SYMLINK_ERROR = 44
    MSACCUCMP_FILE_EXISTS_ERROR = 45
    MSACCUCMP_DANGER_FILE_ERROR = 46
    MSACCUCMP_PARSE_NANO_DUMP_FILE_ERROR = 47
    MSACCUCMP_NAME_ERROR = 48

    def __init__(self: any, code: int, message: str = "") -> None:
        super().__init__(code)
        self.code = code
        self.message = message
