-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored-assert-statements-with-explicit-error-handling (#1825)
* Refactored-assert-statements-with-explicit-error-handling Signed-off-by: sahusiddharth <siddharth.sahu@plaksha.edu.in> * fixed ruff Signed-off-by: sahusiddharth <siddharth.sahu@plaksha.edu.in> * fixed logic in mvtec Signed-off-by: sahusiddharth <siddharth.sahu@plaksha.edu.in> --------- Signed-off-by: sahusiddharth <siddharth.sahu@plaksha.edu.in>
- Loading branch information
1 parent
2c87edf
commit 4c7d7c3
Showing
31 changed files
with
259 additions
and
117 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
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
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,19 @@ | ||
"""Custom Exception Class for Mismatch Detection (MisMatchError).""" | ||
|
||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
||
class MisMatchError(Exception): | ||
"""Exception raised when a mismatch is detected. | ||
Attributes: | ||
message (str): Explanation of the error. | ||
""" | ||
|
||
def __init__(self, message: str = "") -> None: | ||
if message: | ||
self.message = message | ||
else: | ||
self.message = "Mismatch detected." | ||
super().__init__(self.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
Oops, something went wrong.