deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [2/4] git commit: Core: Print warning when ArgumentError occurs on API
Date Thu, 23 Aug 2012 09:23:29 GMT
Core: Print warning when ArgumentError occurs on API

* 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.


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/e9424ef5
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/e9424ef5
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/e9424ef5

Branch: refs/heads/master
Commit: e9424ef5684344b1a28641ae9d7e44030572b550
Parents: b321f53
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Wed Aug 22 15:34:43 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Thu Aug 23 11:24:00 2012 +0200

----------------------------------------------------------------------
 server/lib/deltacloud/api.rb |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/e9424ef5/server/lib/deltacloud/api.rb
----------------------------------------------------------------------
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


Mime
View raw message