incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <mfoj...@redhat.com>
Subject Re: [PATCH 01/10] Remove the begin..rescue block from gogrid_client request.
Date Fri, 06 Aug 2010 09:36:26 GMT
On 05/08/10 15:57 -0400, Chris Lalancette wrote:
>Some of the callers want to be able to handle exceptions
>in their own way, so we should make sure to propagate the
>exception.
>
>Signed-off-by: Chris Lalancette <clalance@redhat.com>
>---
> .../lib/deltacloud/drivers/gogrid/gogrid_client.rb |    6 +-----
> 1 files changed, 1 insertions(+), 5 deletions(-)
>
>diff --git a/server/lib/deltacloud/drivers/gogrid/gogrid_client.rb b/server/lib/deltacloud/drivers/gogrid/gogrid_client.rb
>index 70e0cfc..f4f5796 100644
>--- a/server/lib/deltacloud/drivers/gogrid/gogrid_client.rb
>+++ b/server/lib/deltacloud/drivers/gogrid/gogrid_client.rb
>@@ -31,11 +31,7 @@ class GoGridClient
>   end
>
>   def request(method, params={})
>-    begin
>-      JSON::parse(sendAPIRequest(method, params))
>-    rescue Exception => e
>-      STDERR.puts("ERROR: #{e.message}")
>-    end
>+    JSON::parse(sendAPIRequest(method, params))
>   end

ACK. This will now throw Internal Server error, which is fine, because we
can now catch it and return it in error XML.

>
>   def encode_params(params)
>--
>1.7.2
>

-- 
--------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com, +420 532 294 4307
Ruby / Ruby On Rails Developer
Deltacloud API: http://deltacloud.org
--------------------------------------------------------

Mime
View raw message