mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-23 19:49:24 +01:00
Ignore http error
忽略log打印,防止在check_model_is_latest时打出信息使用户不明所以。 将log改为Error栈 Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/13463005
This commit is contained in:
@@ -70,11 +70,10 @@ def handle_http_post_error(response, url, request_body):
|
|||||||
try:
|
try:
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
except HTTPError as error:
|
except HTTPError as error:
|
||||||
logger.error('Request %s with body: %s exception' %
|
|
||||||
(url, request_body))
|
|
||||||
message = _decode_response_error(response)
|
message = _decode_response_error(response)
|
||||||
logger.error('Response details: %s' % message)
|
raise HTTPError('Request %s with body: %s exception, '
|
||||||
raise error
|
'Response details: %s' %
|
||||||
|
(url, request_body, message)) from error
|
||||||
|
|
||||||
|
|
||||||
def handle_http_response(response, logger, cookies, model_id):
|
def handle_http_response(response, logger, cookies, model_id):
|
||||||
@@ -86,8 +85,7 @@ def handle_http_response(response, logger, cookies, model_id):
|
|||||||
f'Authentication token does not exist, failed to access model {model_id} which may not exist or may be \
|
f'Authentication token does not exist, failed to access model {model_id} which may not exist or may be \
|
||||||
private. Please login first.')
|
private. Please login first.')
|
||||||
message = _decode_response_error(response)
|
message = _decode_response_error(response)
|
||||||
logger.error('Response details: %s' % message)
|
raise HTTPError('Response details: %s' % message) from error
|
||||||
raise error
|
|
||||||
|
|
||||||
|
|
||||||
def raise_on_error(rsp):
|
def raise_on_error(rsp):
|
||||||
|
|||||||
Reference in New Issue
Block a user