Skip to content

Commit 2fdfc1c

Browse files
committed
feat(exc): Add window listing related exceptions
1 parent d35d80b commit 2fdfc1c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/libtmux/exc.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,32 @@ class AmbiguousOption(OptionError):
5454
class WaitTimeout(LibTmuxException):
5555

5656
"""Function timed out without meeting condition"""
57+
58+
59+
class WindowError(LibTmuxException):
60+
61+
"""Any type of window related error"""
62+
63+
64+
class MultipleActiveWindows(WindowError):
65+
66+
"""Multiple active windows"""
67+
68+
def __init__(self, count: int, *args: object):
69+
return super().__init__(f"Multiple active windows: {count} found")
70+
71+
72+
class NoActiveWindow(WindowError):
73+
74+
"""No active window found"""
75+
76+
def __init__(self, *args: object):
77+
return super().__init__("No active windows found")
78+
79+
80+
class NoWindowsExist(WindowError):
81+
82+
"""No windows exist for object"""
83+
84+
def __init__(self, *args: object):
85+
return super().__init__("No windows exist for object")

0 commit comments

Comments
 (0)