mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 19:59:50 +08:00
fix: transform generic error message into correct type
This commit is contained in:
parent
635a53ea38
commit
735e57b73a
|
@ -120,9 +120,10 @@ class BasePluginManager:
|
||||||
if rep.code == -500:
|
if rep.code == -500:
|
||||||
try:
|
try:
|
||||||
error = PluginDaemonError(**json.loads(rep.message))
|
error = PluginDaemonError(**json.loads(rep.message))
|
||||||
self._handle_plugin_daemon_error(error.error_type, error.message, error.args)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise ValueError(f"got error from plugin daemon: {rep.message}, code: {rep.code}")
|
raise ValueError(f"got error from plugin daemon: {rep.message}, code: {rep.code}")
|
||||||
|
|
||||||
|
self._handle_plugin_daemon_error(error.error_type, error.message, error.args)
|
||||||
raise ValueError(f"got error from plugin daemon: {rep.message}, code: {rep.code}")
|
raise ValueError(f"got error from plugin daemon: {rep.message}, code: {rep.code}")
|
||||||
if rep.data is None:
|
if rep.data is None:
|
||||||
raise ValueError("got empty data from plugin daemon")
|
raise ValueError("got empty data from plugin daemon")
|
||||||
|
@ -148,9 +149,10 @@ class BasePluginManager:
|
||||||
if rep.code == -500:
|
if rep.code == -500:
|
||||||
try:
|
try:
|
||||||
error = PluginDaemonError(**json.loads(rep.message))
|
error = PluginDaemonError(**json.loads(rep.message))
|
||||||
self._handle_plugin_daemon_error(error.error_type, error.message, error.args)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise PluginDaemonInnerError(code=rep.code, message=rep.message)
|
raise PluginDaemonInnerError(code=rep.code, message=rep.message)
|
||||||
|
|
||||||
|
self._handle_plugin_daemon_error(error.error_type, error.message, error.args)
|
||||||
raise ValueError(f"got error from plugin daemon: {rep.message}, code: {rep.code}")
|
raise ValueError(f"got error from plugin daemon: {rep.message}, code: {rep.code}")
|
||||||
if rep.data is None:
|
if rep.data is None:
|
||||||
raise ValueError("got empty data from plugin daemon")
|
raise ValueError("got empty data from plugin daemon")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user