deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 3/4] Core: Print warning when ArgumentError occurs on API
Date Wed, 22 Aug 2012 13:38:27 GMT
From: Michal Fojtik <mfojtik@redhat.com>

* When the API library code capture ArgumentError when
  calling a method on backend, it retries the same method
  but without credentials. However ArgumentError often indicate
  regular error in method arguments.

Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/deltacloud/api.rb |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/lib/deltacloud/api.rb b/server/lib/deltacloud/api.rb
index 9567023..4007572 100644
--- a/server/lib/deltacloud/api.rb
+++ b/server/lib/deltacloud/api.rb
@@ -117,7 +117,8 @@ module Deltacloud
       begin
         params = ([@credentials] + args).flatten
         backend.send(name, *params)
-      rescue ArgumentError
+      rescue ArgumentError => e
+        puts "[W] Wrong arguments for #{name}. Omitting credentials injection. (#{e.message})"
         backend.send(name, *args)
       end
     end
-- 
1.7.10.2


Mime
View raw message