Mailinglist Archive: yast-devel (246 mails)

< Previous Next >
[yast-devel] Re: [yast-commit] <rest-service> master : added exception check
  • From: Klaus Kaempf <kkaempf@xxxxxxx>
  • Date: Mon, 24 Aug 2009 14:27:17 +0200
  • Message-id: <20090824122717.GB21498@xxxxxxxxxxxxx>
* Ladislav Slezak <lslezak@xxxxxxxxxx> [Aug 24. 2009 14:10]:
ref: refs/heads/master
commit fe92f302168a171f01f05f8f12fdad6980d9012e
Author: Ladislav Slezak <lslezak@xxxxxxxxxx>
Date: Mon Aug 24 11:00:43 2009 +0200

added exception check
---
.../app/controllers/services_controller.rb | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/plugins/services/app/controllers/services_controller.rb
b/plugins/services/app/controllers/services_controller.rb
index c3d5b51..b9803da 100644
--- a/plugins/services/app/controllers/services_controller.rb
+++ b/plugins/services/app/controllers/services_controller.rb
@@ -8,7 +8,11 @@ class ServicesController < ApplicationController
render ErrorResult.error(403, 1, "no permission") and return
end

- @services = Service.find_all params
+ begin
+ @services = Service.find_all params
+ rescue Exception => e
+ render ErrorResult.error(404, 107, "cannot read services") and return
+ end

This hides valuable information which might be contained in the
original exception.

Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG N├╝rnberg)

--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages