You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2012/03/13 18:28:31 UTC

[4/6] git commit: Core: HTTP code 400 now captured by 'error' helper in Sinatra

Core: HTTP code 400 now captured by 'error' helper in Sinatra

Currently the 40x error codes are not captured by 'error' helper
we have in server.rb. To capture the 400 code we need to use
this helper more expecitely, givin the exception class as param.

With this patch, the 400 errors are reported correctly, using XML
or HTML view.


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

Branch: refs/heads/master
Commit: 364fdb4eb5a8c0aa8fc122c56c21898e2510905d
Parents: 858bd92
Author: Michal Fojtik <mf...@redhat.com>
Authored: Tue Mar 13 14:34:10 2012 +0100
Committer: Michal fojtik <mf...@redhat.com>
Committed: Tue Mar 13 18:29:14 2012 +0100

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


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/364fdb4e/server/lib/deltacloud/server.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/server.rb b/server/lib/deltacloud/server.rb
index 53dd705..d47c87f 100644
--- a/server/lib/deltacloud/server.rb
+++ b/server/lib/deltacloud/server.rb
@@ -85,6 +85,10 @@ error do
   report_error
 end
 
+error Deltacloud::ExceptionHandler::ValidationFailure do
+  report_error
+end
+
 before do
   # Respond with 400, If we don't get a http Host header,
   halt 400, "Unable to find HTTP Host header" if @env['HTTP_HOST'] == nil