incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject svn commit: r1156853 - /incubator/deltacloud/trunk/server/lib/sinatra/rabbit.rb
Date Thu, 11 Aug 2011 22:41:45 GMT
Author: lutter
Date: Thu Aug 11 22:41:45 2011
New Revision: 1156853

URL: http://svn.apache.org/viewvc?rev=1156853&view=rev
Log:
Rabbit: Fixed exception on duplicate operation

Signed-off-by: Michal fojtik <mfojtik@redhat.com>

Modified:
    incubator/deltacloud/trunk/server/lib/sinatra/rabbit.rb

Modified: incubator/deltacloud/trunk/server/lib/sinatra/rabbit.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/sinatra/rabbit.rb?rev=1156853&r1=1156852&r2=1156853&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/sinatra/rabbit.rb (original)
+++ incubator/deltacloud/trunk/server/lib/sinatra/rabbit.rb Thu Aug 11 22:41:45 2011
@@ -265,7 +265,9 @@ module Sinatra
       # This also defines a helper method like show_instance_url that returns
       # the URL to this operation (in request context)
       def operation(name, opts = {}, &block)
-        raise DuplicateOperationException if @operations[name]
+        if @operations.keys.include?(name)
+          raise DuplicateOperationException::new(500, "DuplicateOperation", "Operation #{name}
is already defined", [])
+        end
         @operations[name] = Operation.new(self, name, opts, &block)
       end
 



Mime
View raw message