You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2011/08/10 15:38:29 UTC
[PATCH core 2/2] Rabbit: Fixed exception on duplicate operation
From: Michal Fojtik <mf...@redhat.com>
Signed-off-by: Michal fojtik <mf...@redhat.com>
---
server/lib/sinatra/rabbit.rb | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/server/lib/sinatra/rabbit.rb b/server/lib/sinatra/rabbit.rb
index fe925af..70691d5 100644
--- a/server/lib/sinatra/rabbit.rb
+++ b/server/lib/sinatra/rabbit.rb
@@ -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
--
1.7.4.1