incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lalancette <clala...@redhat.com>
Subject [PATCH] Remove error.cause.
Date Tue, 07 Jun 2011 20:39:58 GMT
As far as I can tell, it was never being set properly, but
was being accessed by some of the error views, causing:

!! Unexpected error while processing request: undefined method `cause' for #<Deltacloud::ExceptionHandler::ProviderError:0x7f422b038558>
undefined method `cause' for #<Deltacloud::ExceptionHandler::ProviderError:0x7f422b038558>

Just remove it until someone needs to use it.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
---
 server/lib/deltacloud/base_driver/exceptions.rb    |    3 ---
 .../lib/deltacloud/helpers/application_helper.rb   |    7 -------
 server/views/errors/403.html.haml                  |    3 ---
 server/views/errors/500.xml.haml                   |    1 -
 server/views/errors/502.xml.haml                   |    1 -
 5 files changed, 0 insertions(+), 15 deletions(-)

diff --git a/server/lib/deltacloud/base_driver/exceptions.rb b/server/lib/deltacloud/base_driver/exceptions.rb
index 5999e30..8b8875a 100644
--- a/server/lib/deltacloud/base_driver/exceptions.rb
+++ b/server/lib/deltacloud/base_driver/exceptions.rb
@@ -28,9 +28,6 @@ module Deltacloud
     end
 
     class BackendError < DeltacloudException
-
-      attr_accessor :cause
-
       def initialize(e, details)
         super(500, e.class.name, e.message, e.backtrace, details)
       end
diff --git a/server/lib/deltacloud/helpers/application_helper.rb b/server/lib/deltacloud/helpers/application_helper.rb
index 573c887..e431e11 100644
--- a/server/lib/deltacloud/helpers/application_helper.rb
+++ b/server/lib/deltacloud/helpers/application_helper.rb
@@ -107,13 +107,6 @@ module ApplicationHelper
   def report_error(code=nil)
     @error, @code = request.env['sinatra.error'], code
     @code = 500 if not @code and not @error.class.method_defined? :code
-    if @error
-      unless @error.class.method_defined? :cause
-        @cause = nil
-      else
-        @cause = @error.cause
-      end
-    end
     response.status = @code || @error.code
     respond_to do |format|
       format.xml { haml :"errors/#{@code || @error.code}", :layout => false }
diff --git a/server/views/errors/403.html.haml b/server/views/errors/403.html.haml
index 23229db..c47ab53 100644
--- a/server/views/errors/403.html.haml
+++ b/server/views/errors/403.html.haml
@@ -5,9 +5,6 @@
     %dt Request URL
     %dd= request.env['REQUEST_URI']
   %di
-    %dt Cause
-    %dd= @cause
-  %di
     %dt Status code
     %dd= response.status
   %di
diff --git a/server/views/errors/500.xml.haml b/server/views/errors/500.xml.haml
index b067212..39416b6 100644
--- a/server/views/errors/500.xml.haml
+++ b/server/views/errors/500.xml.haml
@@ -2,7 +2,6 @@
   %kind backend_error
   %backend{ :driver => driver_symbol }
     %code=response.status
-    %cause= @cause
     - if @error.class.method_defined? :details
       %details< #{cdata @error.details.join("\n")}
   %message< #{cdata @error.message}
diff --git a/server/views/errors/502.xml.haml b/server/views/errors/502.xml.haml
index 87c8e19..aff2dd1 100644
--- a/server/views/errors/502.xml.haml
+++ b/server/views/errors/502.xml.haml
@@ -2,7 +2,6 @@
   %kind backend_error
   %backend{ :driver => driver_symbol }
     %code= @error.code
-    %cause= @error.cause
     - if @error.details
       %details< #{cdata @error.details.join("\n")}
   %message< #{cdata @error.message}
-- 
1.7.4.4


Mime
View raw message