Skip to content

Commit

Permalink
fix: fix error message with trace id (#4853)
Browse files Browse the repository at this point in the history
* fix: fix error message with trace id

Signed-off-by: FogDong <fog@bentoml.com>

* ci: auto fixes from pre-commit.ci

For more information, see https://pre-commit.ci

---------

Signed-off-by: FogDong <fog@bentoml.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and frostming committed Jul 12, 2024
1 parent fc30ed2 commit 9c6af52
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bentoml/_internal/cloud/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ 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 use with trace ID <{resp.headers['x-trace-id']}>: https://bentoml.com/support"
)
if resp.status_code != 200:
raise CloudRESTApiClientError(
f"request failed with status code {resp.status_code}: {resp.text}",
Expand Down

0 comments on commit 9c6af52

Please sign in to comment.