-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom exception class for CLI (#1919)
* Add custom exception class for CLI * Fixed TCs for config_manager --------- Signed-off-by: Yunchu Lee <yunchu.lee@intel.com>
- Loading branch information
Showing
5 changed files
with
60 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""Utils for CLI errors.""" | ||
|
||
# Copyright (C) 2023 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
|
||
class CliException(Exception): | ||
"""Custom exception class for CLI.""" | ||
|
||
|
||
class ConfigValueError(CliException): | ||
"""Configuration value is not suitable for CLI.""" | ||
|
||
def __init__(self, message): | ||
super().__init__(message) | ||
|
||
|
||
class NotSupportedError(CliException): | ||
"""Not supported error.""" | ||
|
||
def __init__(self, message): | ||
super().__init__(message) | ||
|
||
|
||
class FileNotExistError(CliException): | ||
"""Not exist given configuration.""" | ||
|
||
def __init__(self, message): | ||
super().__init__(message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters