deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [7/7] git commit: Core: Fixed various backward compatibility issues in err reporting
Date Tue, 26 Mar 2013 12:36:26 GMT
Core: Fixed various backward compatibility issues in err reporting


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

Branch: refs/heads/master
Commit: 95e86624c87128377891040bc55c0199f545b0fa
Parents: 5ec2798
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Tue Mar 26 11:00:27 2013 +0100
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Tue Mar 26 11:00:27 2013 +0100

----------------------------------------------------------------------
 server/lib/cimi/collections/base.rb                |    4 ++++
 server/lib/deltacloud/helpers/deltacloud_helper.rb |    2 +-
 server/lib/ec2/server.rb                           |    4 ++++
 3 files changed, 9 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/95e86624/server/lib/cimi/collections/base.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/collections/base.rb b/server/lib/cimi/collections/base.rb
index 0d1d0ee..29657ab 100644
--- a/server/lib/cimi/collections/base.rb
+++ b/server/lib/cimi/collections/base.rb
@@ -61,6 +61,10 @@ module CIMI::Collections
       report_error
     end
 
+    error CIMI::Model::NotFound do
+      report_error(404, 'Not found')
+    end
+
     error JSON::ParserError do
       report_error(400, "Bad request (#{request.env['sinatra.error'].message})")
     end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/95e86624/server/lib/deltacloud/helpers/deltacloud_helper.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/helpers/deltacloud_helper.rb b/server/lib/deltacloud/helpers/deltacloud_helper.rb
index 7c9b5d3..d3e0ec8 100644
--- a/server/lib/deltacloud/helpers/deltacloud_helper.rb
+++ b/server/lib/deltacloud/helpers/deltacloud_helper.rb
@@ -128,7 +128,7 @@ module Deltacloud::Helpers
 
       respond_to do |format|
         format.xml {  haml :"errors/common", :layout => false, :locals => { :err =>
error } }
-        format.json { JSON::dump({ :code => code || error.code, :message => message,
:err => error.class.name }) }
+        format.json { JSON::dump({ :code => code || error.code, :message => message,
:error => error.class.name }) }
         format.html {
           begin
             haml :"errors/common", :layout => :error, :locals => { :err => error
}

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/95e86624/server/lib/ec2/server.rb
----------------------------------------------------------------------
diff --git a/server/lib/ec2/server.rb b/server/lib/ec2/server.rb
index 6102fca..90f7815 100644
--- a/server/lib/ec2/server.rb
+++ b/server/lib/ec2/server.rb
@@ -58,6 +58,10 @@ module Deltacloud::EC2
       headers 'Server' => 'Apache-Deltacloud-EC2/' + settings.version
     end
 
+    error Deltacloud::Exceptions::AuthenticationFailure do
+      status 401
+    end
+
     get '/' do
       headers 'Connection' => 'close'
       unless params['Action']


Mime
View raw message