Skip to content

Commit a5236cd

Browse files
committed
Update the error response details
1 parent bdced9b commit a5236cd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ async def provider_authentication_exception_handler(request: Request, exc: Provi
9494
async def invalid_provider_exception_handler(request: Request, exc: InvalidProviderException):
9595
return HTTPException(
9696
status_code=400,
97-
detail=f"Invalid provider: {exc.identifier}"
97+
detail=f"{str(exc)}. Please call the /models endpoint to check the valid providers/models id."
9898
)
9999

100100
# Add exception handler for BaseInvalidProviderSetupException
101101
@app.exception_handler(BaseInvalidProviderSetupException)
102102
async def base_invalid_provider_setup_exception_handler(request: Request, exc: BaseInvalidProviderSetupException):
103103
return HTTPException(
104104
status_code=400,
105-
detail=f"Invalid provider setup: {exc.provider_name}"
105+
detail=str(exc)
106106
)
107107

108108
# Add exception handler for ProviderAPIException
@@ -118,7 +118,7 @@ async def provider_api_exception_handler(request: Request, exc: ProviderAPIExcep
118118
async def base_invalid_request_exception_handler(request: Request, exc: BaseInvalidRequestException):
119119
return HTTPException(
120120
status_code=400,
121-
detail=f"Invalid request for: {exc.provider_name}"
121+
detail=str(exc)
122122
)
123123

124124
# Add exception handler for BaseInvalidForgeKeyException

0 commit comments

Comments
 (0)