On 26/01/12 19:12 +0100, mzatko(a)redhat.com wrote:
From: Maros Zatko <mzatko(a)redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=749376
Added descriptive messages for exceptions when Conductor is unreachable
---
Mostly ACK, this seems to work as advertised, with the caveat that
there should be a unit test to verify that when the method encounters
a call which throws one of the listed errors, it responds
appropriately. Running through the reproducer steps in the BZ is not
the only way we shoudl be proving this is fixed. Please add
appropriate tests before pushing.
-j
lib/aeolus_cli/command/base_command.rb | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/lib/aeolus_cli/command/base_command.rb
b/lib/aeolus_cli/command/base_command.rb
index 48e8eb5..56ebd6b 100644
--- a/lib/aeolus_cli/command/base_command.rb
+++ b/lib/aeolus_cli/command/base_command.rb
@@ -91,6 +91,18 @@ module Aeolus
code = "Unauthorized"
message = "Invalid Credentials, please check ~/.aeolus-cli"
+ elsif e.is_a?(ActiveResource::Redirection)
+ code = "Found"
+ message = "Server tried to redirect to
#{e.response.header['location']}, please check ~/.aeolus-cli"
+
+ elsif e.is_a?(ActiveResource::ServerError)
+ code = "Service Temporarily Unavailable"
+ message = "Please check that Conductor is running."
+
+ elsif e.is_a?(SocketError)
+ code = "Name Or Service Not Found"
+ message = "Please chceck your ~/.aeolus-cli"
+
elsif e.is_a?(TypeError)
code = "Internal Error (TypeError)"
message = e.message
--
1.7.7.6