MCPcopy Create free account
hub / github.com/modelscope/modelscope / _decode_response_error

Function _decode_response_error

modelscope/hub/errors.py:89–94  ·  view source on GitHub ↗
(response: requests.Response)

Source from the content-addressed store, hash-verified

87
88
89def _decode_response_error(response: requests.Response):
90 if 'application/json' in response.headers.get('content-type', ''):
91 message = response.json()
92 else:
93 message = response.content.decode('utf-8')
94 return message
95
96
97def handle_http_post_error(response, url, request_body):

Callers 1

handle_http_post_errorFunction · 0.85

Calls 2

getMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…