chore: Add error handling for missing pre_render method in plugin in web UI

This commit is contained in:
Théophile Diot 2024-05-06 11:00:41 +02:00
parent 3f78491165
commit aa0e7620c4
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -318,6 +318,9 @@ def run_action(plugin: str, function_name: str = ""):
res = method(app=app, args=queries, data=data)
except AttributeError:
if function_name == "pre_render":
return {"status": "ok", "code": 200, "message": "The plugin does not have a pre_render method"}
message = "The plugin does not have a method, see logs for more details"
except:
message = "An error occurred while executing the plugin, see logs for more details"