We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 583ae91 commit 5faa80dCopy full SHA for 5faa80d
src/libtmux/options.py
@@ -148,6 +148,22 @@ def handle_option_error(error: str) -> t.Type[exc.OptionError]:
148
------
149
:exc:`exc.OptionError`, :exc:`exc.UnknownOption`, :exc:`exc.InvalidOption`,
150
:exc:`exc.AmbiguousOption`
151
+
152
+ Examples
153
+ --------
154
+ >>> result = server.cmd(
155
+ ... 'set-option',
156
+ ... 'unknown-option-name',
157
+ ... )
158
159
+ >>> bool(isinstance(result.stderr, list) and len(result.stderr))
160
+ True
161
162
+ >>> import pytest
163
+ >>> from libtmux import exc
164
165
+ >>> with pytest.raises(exc.OptionError):
166
+ ... handle_option_error(result.stderr[0])
167
"""
168
if "unknown option" in error:
169
raise exc.UnknownOption(error)
0 commit comments