mirror of
https://github.com/Jerryplusy/AI-powered-switches.git
synced 2025-07-04 21:29:18 +00:00
22 lines
744 B
Python
22 lines
744 B
Python
from fastapi import HTTPException, status
|
|
|
|
class AICommandParseException(HTTPException):
|
|
def __init__(self, detail: str):
|
|
super().__init__(
|
|
status_code=status.HTTP_400_BAD_REQUEST,
|
|
detail=f"AI command parse error: {detail}"
|
|
)
|
|
|
|
class SwitchConfigException(HTTPException):
|
|
def __init__(self, detail: str):
|
|
super().__init__(
|
|
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
|
detail=f"Switch configuration error: {detail}"
|
|
)
|
|
|
|
class SiliconFlowAPIException(HTTPException):
|
|
def __init__(self, detail: str):
|
|
super().__init__(
|
|
status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
|
|
detail=f"SiliconFlow API error: {detail}"
|
|
) |