mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2025-09-10 15:29:39 +00:00
Initial commit
This commit is contained in:
commit
18c42e67df
247 changed files with 53775 additions and 0 deletions
23
ktransformers/server/exceptions.py
Normal file
23
ktransformers/server/exceptions.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
from fastapi import HTTPException, status
|
||||
|
||||
|
||||
def db_exception():
|
||||
return HTTPException(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
detail="DB Error",
|
||||
)
|
||||
|
||||
|
||||
def not_implemented(what):
|
||||
return HTTPException(
|
||||
status_code=status.HTTP_501_NOT_IMPLEMENTED,
|
||||
detail=f"{what} not implemented",
|
||||
)
|
||||
|
||||
|
||||
def internal_server_error(what):
|
||||
return HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=f"{what}")
|
||||
|
||||
|
||||
def request_error(what):
|
||||
return HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=f"{what}")
|
Loading…
Add table
Add a link
Reference in a new issue