ref: refs/heads/master
commit 73d0d1bfe7f4db8080d27c5c8eeead3cb6801311
Author: Ladislav Slezak
Date: Tue Sep 1 16:00:27 2009 +0200
catch exception, render error message
---
.../app/controllers/services_controller.rb | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/plugins/services/app/controllers/services_controller.rb b/plugins/services/app/controllers/services_controller.rb
index f4aa94b..31e5821 100644
--- a/plugins/services/app/controllers/services_controller.rb
+++ b/plugins/services/app/controllers/services_controller.rb
@@ -25,7 +25,13 @@ class ServicesController < ApplicationController
def show_status
return unless client_permissions
- @response = @client.find(params[:id])
+ begin
+ @response = @client.find(params[:id])
+ rescue ActiveResource::ResourceNotFound => e
+ Rails.logger.error "Resource not found: #{e.to_s}: #{e.response.body}"
+ render :text => _('(cannot read status)') and return
+ end
+
render(:partial =>'status', :object => @response.status, :params => params)
end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org