This commit is contained in:
Timothy Jaeryang Baek committed 2026-06-29 05:47:21 -05:00
1 parent ee5de69e37
commit 0883638027
7 files changed
+86 -43

No files matched your search

+16 -8
View File
@@ -31,7 +31,6 @@ from open_webui.utils.access_control import (
has_permission,
)
from open_webui.utils.auth import get_admin_user, get_verified_user
from open_webui.utils.errors import error_detail
from open_webui.utils.plugin import (
get_tools_cache,
get_tool_module_from_cache,
@@ -295,8 +294,13 @@ async def load_tool_from_url(request: Request, form_data: LoadUrlForm, user=Depe
'name': tool_name,
'content': data,
}
except HTTPException:
raise
except Exception as e:
raise HTTPException(status_code=500, detail=error_detail(e, 'Error fetching tool'))
raise HTTPException(
status_code=500,
detail=ERROR_MESSAGES.DEFAULT(e, 'Error fetching tool'),
)
############################
@@ -401,11 +405,13 @@ async def create_new_tools(
status_code=status.HTTP_400_BAD_REQUEST,
detail=ERROR_MESSAGES.DEFAULT('Error creating tools'),
)
except HTTPException:
raise
except Exception as e:
log.exception(f'Failed to load the tool by id {form_data.id}: {e}')
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=error_detail(e, 'Error creating tool'),
detail=ERROR_MESSAGES.DEFAULT(e, 'Error creating tool'),
)
else:
raise HTTPException(
@@ -552,10 +558,12 @@ async def update_tools_by_id(
detail=ERROR_MESSAGES.DEFAULT('Error updating tools'),
)
except HTTPException:
raise
except Exception as e:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=error_detail(e, 'Error updating tool'),
detail=ERROR_MESSAGES.DEFAULT(e, 'Error updating tool'),
)
@@ -708,7 +716,7 @@ async def get_tools_valves_by_id(
except Exception as e:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=error_detail(e, 'Error getting tool valves'),
detail=ERROR_MESSAGES.DEFAULT(e, 'Error getting tool valves'),
)
@@ -819,7 +827,7 @@ async def update_tools_valves_by_id(
log.exception(f'Failed to update tool valves by id {id}: {e}')
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=error_detail(e, 'Error updating tool valves'),
detail=ERROR_MESSAGES.DEFAULT(e, 'Error updating tool valves'),
)
@@ -861,7 +869,7 @@ async def get_tools_user_valves_by_id(
except Exception as e:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=error_detail(e, 'Error getting tool user valves'),
detail=ERROR_MESSAGES.DEFAULT(e, 'Error getting tool user valves'),
)
@@ -959,7 +967,7 @@ async def update_tools_user_valves_by_id(
log.exception(f'Failed to update user valves by id {id}: {e}')
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=error_detail(e, 'Error updating tool user valves'),
detail=ERROR_MESSAGES.DEFAULT(e, 'Error updating tool user valves'),
)
else:
raise HTTPException(