Home / Function/ _make_status_error() — anthropic-sdk-python Function Reference

_make_status_error() — anthropic-sdk-python Function Reference

Architecture documentation for the _make_status_error() function in _client.py from the anthropic-sdk-python codebase.

Function python AnthropicClient AsyncAPI calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  40482071_6aff_dca3_651e_a2ac443d6147["_make_status_error()"]
  0517492b_78c2_27e9_22ae_aae3b5f0e93e["Anthropic"]
  40482071_6aff_dca3_651e_a2ac443d6147 -->|defined in| 0517492b_78c2_27e9_22ae_aae3b5f0e93e
  6608a5d5_1db6_f06b_872d_cdfe9c388652["_make_status_error()"]
  6608a5d5_1db6_f06b_872d_cdfe9c388652 -->|calls| 40482071_6aff_dca3_651e_a2ac443d6147
  6608a5d5_1db6_f06b_872d_cdfe9c388652["_make_status_error()"]
  40482071_6aff_dca3_651e_a2ac443d6147 -->|calls| 6608a5d5_1db6_f06b_872d_cdfe9c388652
  style 40482071_6aff_dca3_651e_a2ac443d6147 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/_client.py lines 254–290

    def _make_status_error(
        self,
        err_msg: str,
        *,
        body: object,
        response: httpx.Response,
    ) -> APIStatusError:
        if response.status_code == 400:
            return _exceptions.BadRequestError(err_msg, response=response, body=body)

        if response.status_code == 401:
            return _exceptions.AuthenticationError(err_msg, response=response, body=body)

        if response.status_code == 403:
            return _exceptions.PermissionDeniedError(err_msg, response=response, body=body)

        if response.status_code == 404:
            return _exceptions.NotFoundError(err_msg, response=response, body=body)

        if response.status_code == 409:
            return _exceptions.ConflictError(err_msg, response=response, body=body)

        if response.status_code == 413:
            return _exceptions.RequestTooLargeError(err_msg, response=response, body=body)

        if response.status_code == 422:
            return _exceptions.UnprocessableEntityError(err_msg, response=response, body=body)

        if response.status_code == 429:
            return _exceptions.RateLimitError(err_msg, response=response, body=body)

        if response.status_code == 529:
            return _exceptions.OverloadedError(err_msg, response=response, body=body)

        if response.status_code >= 500:
            return _exceptions.InternalServerError(err_msg, response=response, body=body)
        return APIStatusError(err_msg, response=response, body=body)

Subdomains

Frequently Asked Questions

What does _make_status_error() do?
_make_status_error() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/_client.py.
Where is _make_status_error() defined?
_make_status_error() is defined in src/anthropic/_client.py at line 254.
What does _make_status_error() call?
_make_status_error() calls 1 function(s): _make_status_error.
What calls _make_status_error()?
_make_status_error() is called by 1 function(s): _make_status_error.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free