ref: refs/heads/master
commit 39f124d9da5c8d72b972eaf20c32272a5529b048
Author: Duncan Mac-Vicar P
Date: Mon Oct 26 12:41:16 2009 +0100
use classes instead of strings, more clear
---
.../app/controllers/application_controller.rb | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/webservice/app/controllers/application_controller.rb b/webservice/app/controllers/application_controller.rb
index 1ab95d5..c924451 100644
--- a/webservice/app/controllers/application_controller.rb
+++ b/webservice/app/controllers/application_controller.rb
@@ -6,15 +6,15 @@ require 'exceptions'
class ApplicationController < ActionController::Base
#render only pure text to simple show it on frontend
- rescue_from 'Exception' do |exception|
+ rescue_from Exception do |exception|
render :text => "#{exception.message}\n Backtrace:\n #{exception.backtrace.join("\n")}", :status => 500
end
- rescue_from 'BackendException' do |exception|
+ rescue_from BackendException do |exception|
render :xml => exception, :status => 503
end
- rescue_from 'InvalidParameters' do |exception|
+ rescue_from InvalidParameters do |exception|
render :xml => exception, :status => 422 #422-resource invalid
end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org