mirror of
https://github.com/onyx-and-iris/voicemeeter-api-python.git
synced 2024-11-22 02:50: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]
|
||||
name = "voicemeeter-api"
|
||||
version = "2.3.7"
|
||||
version = "2.4.0"
|
||||
description = "A Python wrapper for the Voiceemeter API"
|
||||
authors = ["onyx-and-iris <code@onyxandiris.online>"]
|
||||
license = "MIT"
|
||||
|
@ -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}")
|
||||
|
Loading…
Reference in New Issue
Block a user