From: Michal Fojtik <[email protected]>

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.

Signed-off-by: Michal fojtik <[email protected]>
---
 server/lib/deltacloud/server.rb |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

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
-- 
1.7.9.1

Reply via email to