refac
This commit is contained in:
1 parent
ee5de69e37
commit
0883638027
7 files changed
+86
-43
No files matched your search
@@ -20,7 +20,6 @@ from open_webui.models.skills import (
|
||||
)
|
||||
from open_webui.utils.access_control import filter_allowed_access_grants, has_permission
|
||||
from open_webui.utils.auth import get_admin_user, get_verified_user
|
||||
from open_webui.utils.errors import error_detail
|
||||
from pydantic import BaseModel
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
@@ -210,11 +209,13 @@ async def create_new_skill(
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
detail=ERROR_MESSAGES.DEFAULT('Error creating skill'),
|
||||
)
|
||||
except HTTPException:
|
||||
raise
|
||||
except Exception as e:
|
||||
log.exception(f'Failed to create skill: {e}')
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
detail=error_detail(e, 'Error creating skill'),
|
||||
detail=ERROR_MESSAGES.DEFAULT(e, 'Error creating skill'),
|
||||
)
|
||||
|
||||
|
||||
@@ -335,10 +336,12 @@ async def update_skill_by_id(
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
detail=ERROR_MESSAGES.DEFAULT('Error updating skill'),
|
||||
)
|
||||
except HTTPException:
|
||||
raise
|
||||
except Exception as e:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
detail=error_detail(e, 'Error updating skill'),
|
||||
detail=ERROR_MESSAGES.DEFAULT(e, 'Error updating skill'),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user