summaryrefslogtreecommitdiff
path: root/ironic_python_agent/errors.py
diff options
context:
space:
mode:
authorJulia Kreger <juliaashleykreger@gmail.com>2020-08-20 08:21:50 -0700
committerJulia Kreger <juliaashleykreger@gmail.com>2020-08-20 13:45:47 -0700
commitf670f704f3e4bf9b05a97d1f39ab99febfe29cf7 (patch)
tree6a8d3fa463beacd79a1b7e256b3ee6ae660fb0a7 /ironic_python_agent/errors.py
parentba6ca246f542b49e59d51692231a59abdaf6290b (diff)
downloadironic-python-agent-f670f704f3e4bf9b05a97d1f39ab99febfe29cf7.tar.gz
Clarify connection error on heartbeats
Heartbeat connection errors are often a sign of a transitory network failures which may resolve themselves. But an operator looking at the screen doesn't necessarilly know that. They don't understand that there could have been a network failure, or a misconfiguration that caused the connectivity failure and soft of kind of default to "well it failed" without further clarification. As such, this patch adds explicit catching of the requests ConnectionError exception and rasies a new internal error with a more verbose error message in that event to provide operators with additional clarity. Change-Id: I4cb2c0d1f577df1c4451308bd86efa8f94390b0c Story: 2008046 Task: 40709
Diffstat (limited to 'ironic_python_agent/errors.py')
-rw-r--r--ironic_python_agent/errors.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/ironic_python_agent/errors.py b/ironic_python_agent/errors.py
index 99bbe2b8..bf0253dd 100644
--- a/ironic_python_agent/errors.py
+++ b/ironic_python_agent/errors.py
@@ -348,3 +348,13 @@ class ClockSyncError(RESTError):
"""Error raised when attempting to sync the system clock."""
message = 'Error syncing system clock'
+
+
+class HeartbeatConnectionError(IronicAPIError):
+ """Transitory connection failure occured attempting to contact the API."""
+
+ message = ("Error attempting to heartbeat - Possible transitory network "
+ "failure or blocking port may be present.")
+
+ def __init__(self, details):
+ super(HeartbeatConnectionError, self).__init__(details)