diff --git a/pyproject.toml b/pyproject.toml index 929f912..8382402 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "voicemeeter-api" -version = "2.3.7" +version = "2.4.0" description = "A Python wrapper for the Voiceemeter API" authors = ["onyx-and-iris "] license = "MIT" diff --git a/voicemeeterlib/error.py b/voicemeeterlib/error.py index f51e4e1..10be769 100644 --- a/voicemeeterlib/error.py +++ b/voicemeeterlib/error.py @@ -1,19 +1,22 @@ -class InstallError(Exception): - """Exception raised when installation errors occur""" +class VMError(Exception): + """Base VM Exception class. Raised when general errors occur.""" - -class CAPIError(Exception): - """Exception raised when the C-API returns error values""" - - 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}" + def __init__(self, msg): + self.message = msg super().__init__(self.message) def __str__(self): return f"{type(self).__name__}: {self.message}" -class VMError(Exception): - """Exception raised when general errors occur""" +class InstallError(VMError): + """Exception raised when installation errors occur""" + + +class CAPIError(VMError): + """Exception raised when the C-API returns an error code""" + + def __init__(self, fn_name, code, msg=None): + self.fn_name = fn_name + self.code = code + super(CAPIError, self).__init__(msg if msg else f"{fn_name} returned {code}")