Skip to content

Commit

Permalink
DEBUG: Add additional logging for authz errors (#539)
Browse files Browse the repository at this point in the history
* Add debug log for authz errors

* no cover
  • Loading branch information
dmchoiboi authored Jun 14, 2024
1 parent 6447c5f commit 4c6b176
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions model-engine/model_engine_server/api/llms_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ async def get_model_endpoint(
)
return await use_case.execute(user=auth, model_endpoint_name=model_endpoint_name)
except (ObjectNotFoundException, ObjectNotAuthorizedException) as exc:
if isinstance(exc, ObjectNotAuthorizedException): # pragma: no cover
logger.info(
f"GET /llm/model-endpoints/{model_endpoint_name} for {auth} failed with authz error {exc.args}"
)

raise HTTPException(
status_code=404,
detail=f"Model Endpoint {model_endpoint_name} was not found.",
Expand Down

0 comments on commit 4c6b176

Please sign in to comment.