File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,12 @@ def invocation_logger(id: InvocationID) -> logging.Logger:
3333InvocationLogger = Annotated [logging .Logger , Depends (invocation_logger )]
3434
3535
36- class InvocationCancelledError (SystemExit ):
37- pass
36+ class InvocationCancelledError (BaseException ):
37+ """An invocation was cancelled by the user.
38+
39+ Note that this inherits from BaseException so won't be caught by
40+ `except Exception`, it must be handled specifically.
41+ """
3842
3943
4044class CancelEvent (threading .Event ):
Original file line number Diff line number Diff line change 11"""A submodule for custom LabThings-FastAPI Exceptions"""
22
3+ from .dependencies .invocation import InvocationCancelledError
4+
35
46class NotConnectedToServerError (RuntimeError ):
57 """The Thing is not connected to a server
@@ -9,3 +11,6 @@ class NotConnectedToServerError(RuntimeError):
911 connected to a ThingServer. A server connection is needed
1012 to manage asynchronous behaviour.
1113 """
14+
15+
16+ __all__ = ["NotConnectedToServerError" , "InvocationCancelledError" ]
You can’t perform that action at this time.
0 commit comments