Skip to content

Commit 000a896

Browse files
committed
feat(exc): Add Pane related exceptions
1 parent 959cdf0 commit 000a896

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/libtmux/exc.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
~~~~~~~~~~~
55
66
"""
7+
import typing as t
78

89

910
class LibTmuxException(Exception):
@@ -64,6 +65,19 @@ class WaitTimeout(LibTmuxException):
6465
"""Function timed out without meeting condition"""
6566

6667

68+
class PaneError(LibTmuxException):
69+
"""Any type of pane related error"""
70+
71+
72+
class PaneNotFound(PaneError):
73+
"""Pane not found"""
74+
75+
def __init__(self, pane_id: t.Optional[str] = None, *args: object):
76+
if pane_id is not None:
77+
return super().__init__(f"Pane not found: {pane_id}")
78+
return super().__init__("Pane not found")
79+
80+
6781
class WindowError(LibTmuxException):
6882

6983
"""Any type of window related error"""

0 commit comments

Comments
 (0)