Skip to content

Commit 1232510

Browse files
committed
feat(exc): {Pane,Window,Session}NotFound
1 parent 9cda65a commit 1232510

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/tmuxp/exc.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,36 @@ class WorkspaceError(TmuxpException):
2121
"""Error parsing tmuxp workspace data."""
2222

2323

24+
class SessionNotFound(TmuxpException):
25+
def __init__(
26+
self, session_target: t.Optional[str] = None, *args: object, **kwargs: object
27+
) -> None:
28+
msg = "Session not found"
29+
if session_target is not None:
30+
msg += f": {session_target}"
31+
return super().__init__(msg, *args, **kwargs)
32+
33+
34+
class WindowNotFound(TmuxpException):
35+
def __init__(
36+
self, window_target: t.Optional[str] = None, *args: object, **kwargs: object
37+
) -> None:
38+
msg = "Window not found"
39+
if window_target is not None:
40+
msg += f": {window_target}"
41+
return super().__init__(msg, *args, **kwargs)
42+
43+
44+
class PaneNotFound(TmuxpException):
45+
def __init__(
46+
self, pane_target: t.Optional[str] = None, *args: object, **kwargs: object
47+
) -> None:
48+
msg = "Pane not found"
49+
if pane_target is not None:
50+
msg += f": {pane_target}"
51+
return super().__init__(msg, *args, **kwargs)
52+
53+
2454
class EmptyWorkspaceException(WorkspaceError):
2555

2656
"""Workspace file is empty."""

0 commit comments

Comments
 (0)