Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions fastapi_crudrouter/core/databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ async def route(
query = self.table.insert()
rid = await self.db.execute(query=query, values=schema.dict())
return {self._pk: rid, **schema.dict()}
except Exception:
raise HTTPException(422, "Key already exists")

except Exception as e:
raise HTTPException(422, "SQL error")
return route

def _update(self, *args: Any, **kwargs: Any) -> CALLABLE:
Expand Down