mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Add error handling for missing plugin in custom_plugin function
This commit is contained in:
parent
9eba06fcfd
commit
13b2f888cc
1 changed files with 7 additions and 0 deletions
|
|
@ -1284,6 +1284,13 @@ def custom_plugin(plugin: str):
|
|||
curr_plugin = plug
|
||||
break
|
||||
|
||||
if not plugin_id:
|
||||
message = f'Plugin "{plugin}" not found'
|
||||
app.logger.error(message)
|
||||
if request.method == "GET":
|
||||
return message, 404
|
||||
return {"message": f'Plugin "{plugin}" not found'}, 404
|
||||
|
||||
# Get USE_<NAME> if exists
|
||||
# Check if the plugin is used by one service
|
||||
config = app.config["CONFIG"].get_config(methods=False)
|
||||
|
|
|
|||
Loading…
Reference in a new issue