Handles the HTTP response, raising specific errors based on the response status and error type. :param response: The HTTP response object to handle. :raises: Raises specific errors based on the response status and error type.
(response)
| 55 | |
| 56 | |
| 57 | async def handle_response(response): |
| 58 | """ |
| 59 | Handles the HTTP response, raising specific errors based on the response status and error type. |
| 60 | |
| 61 | :param response: The HTTP response object to handle. |
| 62 | :raises: Raises specific errors based on the response status and error type. |
| 63 | """ |
| 64 | if response.status != 200: |
| 65 | result = await response.json() |
| 66 | raise_http_error( |
| 67 | ErrorCode.PROVIDER_ERROR, |
| 68 | f"Error on calling provider model API: {result}", |
| 69 | ) |
| 70 | |
| 71 | |
| 72 | def checksum(data) -> str: |
nothing calls this directly
no test coverage detected