Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: direct return response if tracer id is null #4899

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/bentoml/_internal/cloud/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,15 @@ def _is_not_found(self, resp: httpx.Response) -> bool:

def _check_resp(self, resp: httpx.Response) -> None:
if resp.status_code >= 500:
raise CloudRESTApiClientError(
f"Oops, something went wrong with BentoCloud. Please report to us with trace ID <{resp.headers['x-trace-id']}>: https://bentoml.com/support"
)
if "x-trace-id" in resp.headers:
raise CloudRESTApiClientError(
f"Oops, something went wrong with BentoCloud. Please report to us with trace ID <{resp.headers['x-trace-id']}>: https://bentoml.com/support"
)
else:
raise CloudRESTApiClientError(
f"request failed with status code {resp.status_code}: {resp.text}",
error_code=resp.status_code,
)
if resp.status_code != 200:
raise CloudRESTApiClientError(
f"request failed with status code {resp.status_code}: {resp.text}",
Expand Down
Loading