1# Copyright 2019 Huawei Technologies Co., Ltd 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# ============================================================================== 15""" 16enums for exceptions 17""" 18 19 20class BaseEnum: 21 """ 22 Enum base class. 23 """ 24 25 26class LogRuntime(BaseEnum): 27 """Log runtime enum.""" 28 RT_HOST = 0b01 29 RT_DEVICE = 0b10 30 31 32class ErrorCodeType(BaseEnum): 33 """Error code type enum.""" 34 ERROR_CODE = 0b01 35 EXCEPTION_CODE = 0b10 36 37 38class ErrorLevel(BaseEnum): 39 """Error level.""" 40 COMMON_LEVEL = 0b000 41 SUGGESTION_LEVEL = 0b001 42 MINOR_LEVEL = 0b010 43 MAJOR_LEVEL = 0b011 44 CRITICAL_LEVEL = 0b100 45