Mailinglist Archive: yast-commit (1914 mails)

< Previous Next >
[yast-commit] <web-client> basesystem : catch exception, render error message
  • From: Ladislav Slezak <lslezak@xxxxxxxxxx>
  • Date: Tue, 1 Sep 2009 16:00:27 +0200
  • Message-id: <E1Mlexj-0003nq-HO@xxxxxxxxxxxxxxxx>
ref: refs/heads/basesystem
commit 73d0d1bfe7f4db8080d27c5c8eeead3cb6801311
Author: Ladislav Slezak <lslezak@xxxxxxxxxx>
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@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages