def _wrap_http_exceptions():
"""Reraise osc-lib exceptions with detailed messages."""
try:
yield
except ks_exceptions.HttpError as exc:
detail = json.loads(exc.response.content)['errors'][0]['detail']
msg = detail.split('\n')[-1].strip()
exc_class = _http_error_to_exc.get(exc.http_status,
exceptions.CommandError)
six.raise_from(exc_class(exc.http_status, msg), exc)
评论列表
文章目录