1#!/usr/bin/env python3 2# -- coding: utf-8 -- 3# 4# Copyright (c) 2025 Huawei Device Co., Ltd. 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16# 17 18from pathlib import Path 19 20 21class RunnerException(Exception): 22 pass 23 24 25class DownloadException(RunnerException): 26 pass 27 28 29class UnzipException(RunnerException): 30 pass 31 32 33class InvalidConfiguration(RunnerException): 34 pass 35 36 37class ParameterNotFound(RunnerException): 38 pass 39 40 41class MacroNotExpanded(RunnerException): 42 pass 43 44 45class RunnerCustomSchemeException(RunnerException): 46 pass 47 48 49class TestNotExistException(RunnerException): 50 pass 51 52 53class StepUtilsException(RunnerException): 54 pass 55 56 57class MalformedStepConfigurationException(RunnerException): 58 def __init__(self, message: str) -> None: 59 self.full_message = f"Malformed configuration file: {message}" 60 super().__init__(self, self.full_message) 61 62 63class IncorrectEnumValue(RunnerException): 64 pass 65 66 67class IncorrectFileFormatChapterException(RunnerException): 68 def __init__(self, chapters_name: str | Path) -> None: 69 message = f"Incorrect file format: {chapters_name}" 70 super().__init__(self, message) 71 72 73class CyclicDependencyChapterException(RunnerException): 74 def __init__(self, item: str) -> None: 75 message = f"Cyclic dependency: {item}" 76 super().__init__(self, message) 77 78 79class UnknownException(RunnerException): 80 pass 81 82 83class SetupException(RunnerException): 84 pass 85 86 87class FileNotFoundException(RunnerException): 88 pass 89 90 91class YamlException(RunnerException): 92 pass 93 94 95class TimeoutException(RunnerException): 96 pass 97