[TRAIN-AND-OLDER] Improve timeout error handling
For many releases we have seen overall deployment and workflow exections that timeout throw a json decode error. This is usually because either the mistral execution completely failed (unhandled exception), something during the deployment hangs (bad network config), or the --timeout was less than the time it takes to run an action. If we get an exception waiting for timeouts that isn't already a websocket timeout or something to that effect, we should catch it and print some useful messaging that the user can use to begin their troubleshooting. Change-Id: Ie239f3fc11bbf95dc9af9786b288f6e8aef1193a Closes-Bug: #1882134
This commit is contained in:
parent
88d8462582
commit
ecf2241668
|
@ -163,6 +163,13 @@ class WebsocketClient(object):
|
|||
raise exceptions.WebSocketTimeout()
|
||||
except websocket.WebSocketConnectionClosedException:
|
||||
raise exceptions.WebSocketConnectionClosed()
|
||||
except Exception as e:
|
||||
err = ("An exception occurred while waiting for messages. "
|
||||
"This can indicate a timeout or a failure in the "
|
||||
"workflow execution. To troubleshoot, check the "
|
||||
"workflow executions for failures and/or the "
|
||||
"ansible logs. Exception: {0!r}".format(e))
|
||||
raise exceptions.WorkflowServiceError(err)
|
||||
|
||||
def __enter__(self):
|
||||
"""Return self to allow usage as a context manager"""
|
||||
|
|
Loading…
Reference in New Issue