voicemeeter-api-python/voicemeeterlib/error.py

20 lines
556 B
Python
Raw Normal View History

2022-06-16 14:07:12 +01:00
class InstallError(Exception):
2023-06-23 03:42:34 +01:00
"""Exception raised when installation errors occur"""
2022-06-16 14:07:12 +01:00
class CAPIError(Exception):
2023-06-23 03:42:34 +01:00
"""Exception raised when the C-API returns error values"""
2022-06-16 14:07:12 +01:00
def __init__(self, fn_name, code, msg=None):
self.fn_name = fn_name
self.code = code
self.message = msg if msg else f"{fn_name} returned {code}"
super().__init__(self.message)
def __str__(self):
return f"{type(self).__name__}: {self.message}"
2022-06-16 14:07:12 +01:00
class VMError(Exception):
2023-06-23 03:42:34 +01:00
"""Exception raised when general errors occur"""