refactor: preserve exception context when re-raising in except blocks (#40432)

Co-authored-by: Asuka Minato <i@asukaminato.eu.org>
This commit is contained in:
Valor 2026-09-07 13:52:29 +00:00 committed by GitHub
parent 8fc11b2927
commit 93287f22a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -380,8 +380,8 @@ class BasePluginClient:
if rep.code == -500:
try:
error = PluginDaemonError.model_validate(json.loads(rep.message))
except Exception:
raise PluginDaemonInnerError(code=rep.code, message=rep.message)
except Exception as e:
raise PluginDaemonInnerError(code=rep.code, message=rep.message) from e
logger.error("Error in stream response for plugin %s", rep.__dict__)
self._handle_plugin_daemon_error(error.error_type, error.message)