Skip to content

Commit 43734ab

Browse files
committed
feat(exc,query_list): New exceptions for lookups
1 parent 773eaa6 commit 43734ab

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/libtmux/_internal/query_list.py

+10
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,16 @@ def lookup_iregex(
244244
}
245245

246246

247+
class PKRequiredException(Exception):
248+
def __init__(self, *args: object):
249+
return super().__init__("items() require a pk_key exists")
250+
251+
252+
class OpNotFound(ValueError):
253+
def __init__(self, op: str, *args: object):
254+
return super().__init__(f"{op} not in LOOKUP_NAME_MAP")
255+
256+
247257
class QueryList(List[T]):
248258
"""Filter list of object/dictionaries. For small, local datasets.
249259

0 commit comments

Comments
 (0)