ec436095dd
Book-CI / test (macos-latest) (push) Has been cancelled
Book-CI / test (ubuntu-latest) (push) Has been cancelled
Book-CI / test (windows-latest) (push) Has been cancelled
Release Fake Tag / publish (push) Has been cancelled
Deploy / deploy (macos-latest) (push) Has been cancelled
Deploy / deploy (ubuntu-latest) (push) Has been cancelled
Deploy / deploy (windows-latest) (push) Has been cancelled
Release to PyPI / Build & publish sglang-kt (push) Has been cancelled
Release to PyPI / Build kt-kernel (Python 3.11) (push) Has been cancelled
Release to PyPI / Build kt-kernel (Python 3.12) (push) Has been cancelled
Release to PyPI / Publish kt-kernel to PyPI (push) Has been cancelled
24 lines
578 B
Python
24 lines
578 B
Python
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}")
|