MCPcopy
hub / github.com/nonebot/nonebot2 / set_exception

Method set_exception

nonebot/internal/params.py:150–158  ·  view source on GitHub ↗

设置子依赖异常

(self, exception: BaseException)

Source from the content-addressed store, hash-verified

148 self._waiter.set()
149
150 def set_exception(self, exception: BaseException) -> None:
151 """设置子依赖异常"""
152
153 if self._state != CacheState.PENDING:
154 raise RuntimeError(f"Cache state invalid: {self._state}")
155
156 self._exception = exception
157 self._state = CacheState.FINISHED
158 self._waiter.set()
159
160 async def wait(self):
161 """等待子依赖结果"""

Callers 1

_solveMethod · 0.95

Calls 1

setMethod · 0.80

Tested by

no test coverage detected