deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 1/6] Core: Make exception reporting silent on tests
Date Fri, 20 Jul 2012 15:45:12 GMT
From: Michal Fojtik <mfojtik@redhat.com>


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

diff --git a/server/lib/deltacloud/drivers/exceptions.rb b/server/lib/deltacloud/drivers/exceptions.rb
index a89b05f..d5a8bc3 100644
--- a/server/lib/deltacloud/drivers/exceptions.rb
+++ b/server/lib/deltacloud/drivers/exceptions.rb
@@ -177,7 +177,9 @@ module Deltacloud
           if exdef.match?($!)
             new_exception = exdef.handler($!)
             m = new_exception.message.nil? ? $!.message : new_exception.message
-            $stderr.send(report_method, "#{[$!.class.to_s, m].join(':')}\n#{$!.backtrace[0..10].join("\n")}")
+            unless ENV['RACK_ENV'] == 'test'
+              $stderr.send(report_method, "#{[$!.class.to_s, m].join(':')}\n#{$!.backtrace[0..10].join("\n")}")
+            end
             raise exdef.handler($!) unless new_exception.nil?
           end
         end
-- 
1.7.10.2


Mime
View raw message