mirror of
https://github.com/onyx-and-iris/nvda-voicemeeter.git
synced 2026-04-07 18:03:35 +00:00
define exception hierarchy
allow is_running to return values x>=0
This commit is contained in:
11
src/nvda_voicemeeter/errors.py
Normal file
11
src/nvda_voicemeeter/errors.py
Normal file
@@ -0,0 +1,11 @@
|
||||
class NVDAVMError(Exception):
|
||||
"""Base NVDAVM error class"""
|
||||
|
||||
|
||||
class NVDAVMCAPIError(NVDAVMError):
|
||||
"""Exception raised when the NVDA C-API returns an error code"""
|
||||
|
||||
def __init__(self, fn_name, code):
|
||||
self.fn_name = fn_name
|
||||
self.code = code
|
||||
super().__init__(f"{self.fn_name} returned {self.code}")
|
||||
Reference in New Issue
Block a user