Skip to content
This repository was archived by the owner on Feb 25, 2024. It is now read-only.

Commit f92e12d

Browse files
authored
core: improve sagemaker middleware error message (#52)
1 parent 7af0291 commit f92e12d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

bentoctl_sagemaker/sagemaker/service.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,9 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
4747
else:
4848
api_path = req.headers[AWS_CUSTOM_ENDPOINT_HEADER]
4949
if api_path not in svc.apis:
50-
logger.error(
51-
"API Service passed via the '{AWS_CUSTOM_ENDPOINT_HEADER}' not found in the bentoml service."
52-
)
53-
raise BentoMLException(
54-
"API Service passed via the '{AWS_CUSTOM_ENDPOINT_HEADER}' not found in the bentoml service."
55-
)
50+
message = f"API Service passed via the '{AWS_CUSTOM_ENDPOINT_HEADER}' header '{api_path}' not found in the bentoml service."
51+
logger.error(message)
52+
raise BentoMLException(message)
5653
scope["path"] = "/" + api_path
5754

5855
await self.app(scope, receive, send)

0 commit comments

Comments
 (0)