Skip to content

Commit

Permalink
cloudvision/cvlib: Add a new classification for failure-to-log except…
Browse files Browse the repository at this point in the history
…ions

Fixes=Bug928732

Change-Id: I25cf58ccb6d1745469007169f218c184bfeb26ac
  • Loading branch information
konall committed Mar 25, 2024
1 parent 91d0cfd commit 7962c4f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cloudvision/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore # mypy issue #1422

__version__ = "1.18.0"
__version__ = "1.19.0"
14 changes: 14 additions & 0 deletions cloudvision/cvlib/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,20 @@ def __init__(self, message: str, errCode: Optional[int] = None, errMsg: Optional
self.errMsg = errMsg


class LoggingFailed(ScriptException):
"""Exception raised when a logging request fails."""

__noReasonFail = "Failed to post log with no reason specified"

def __init__(self, message: str = ""):
super().__init__(message)

def __str__(self):
if not self.message:
return self.__noReasonFail
return f"Failed to post log: {self.message}"


class TimeoutExpiry(ScriptException):
"""
Exception to raise when alarm signals are used in scripts as timers so that script writers
Expand Down

0 comments on commit 7962c4f

Please sign in to comment.