Catch attrbute error for other APIs

Depending on the failure, ironic can return what
gets translated to unicode, which can generate an
AttributeError when the exception attempts to be
examined to report the error, which suppresses
the original error.

Added AttributeError to the exception catch.

Change-Id: I246c2e797a7ed22f990a264856c7cbda18be7ca5
This commit is contained in:
Julia Kreger 2017-08-31 20:01:46 +00:00
parent f1cd4019cd
commit 3cf201fb6a
1 changed files with 3 additions and 0 deletions

View File

@ -148,6 +148,9 @@ def raise_from_response(response, error_message=None):
except ValueError:
if response.reason:
remote_error += " {reason}".format(reason=response.reason)
except AttributeError:
if response.reason:
remote_error += " {reason}".format(reason=response.reason)
_log_response_extras(response)