deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [6/6] git commit: Core: Make exception reporting silent on tests
Date Mon, 23 Jul 2012 09:06:00 GMT
Core: Make exception reporting silent on tests


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

Branch: refs/heads/master
Commit: 94cfc44e7f288c0b400620e4478e654358a2be97
Parents: 9e87257
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Fri Jul 20 15:36:36 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Fri Jul 20 15:36:36 2012 +0200

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/exceptions.rb |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


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


Mime
View raw message