mirror of
https://github.com/onyx-and-iris/voicemeeter-api-python.git
synced 2024-11-22 11:00:47 +00:00
InstallError and CAPIError classes
now subclass VMError minor version bump
This commit is contained in:
parent
6b79c091e8
commit
e96151cd5a
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "voicemeeter-api"
|
name = "voicemeeter-api"
|
||||||
version = "2.3.7"
|
version = "2.4.0"
|
||||||
description = "A Python wrapper for the Voiceemeter API"
|
description = "A Python wrapper for the Voiceemeter API"
|
||||||
authors = ["onyx-and-iris <code@onyxandiris.online>"]
|
authors = ["onyx-and-iris <code@onyxandiris.online>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
@ -1,19 +1,22 @@
|
|||||||
class InstallError(Exception):
|
class VMError(Exception):
|
||||||
"""Exception raised when installation errors occur"""
|
"""Base VM Exception class. Raised when general errors occur."""
|
||||||
|
|
||||||
|
def __init__(self, msg):
|
||||||
class CAPIError(Exception):
|
self.message = msg
|
||||||
"""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}"
|
|
||||||
super().__init__(self.message)
|
super().__init__(self.message)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{type(self).__name__}: {self.message}"
|
return f"{type(self).__name__}: {self.message}"
|
||||||
|
|
||||||
|
|
||||||
class VMError(Exception):
|
class InstallError(VMError):
|
||||||
"""Exception raised when general errors occur"""
|
"""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}")
|
||||||
|
Loading…
Reference in New Issue
Block a user