On Monday 21 September 2009 12:48:10 Martin Vidner wrote: > ref: refs/heads/master > commit 31a423025739c568c47ccd8a49faca381da583da > Author: Martin Vidner <[email protected]> > Date: Mon Sep 21 12:18:07 2009 +0200 > > Switched to the InvalidParameters exception. > --- > .../app/controllers/network/dns_controller.rb | 2 +- > .../app/controllers/network/hostname_controller.rb | 2 +- > .../controllers/network/interfaces_controller.rb | 2 +- > .../app/controllers/network/routes_controller.rb | 2 +- > 4 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/plugins/network/app/controllers/network/dns_controller.rb > b/plugins/network/app/controllers/network/dns_controller.rb index > 810b7df..bcfe961 100644 > --- a/plugins/network/app/controllers/network/dns_controller.rb > +++ b/plugins/network/app/controllers/network/dns_controller.rb > @@ -11,7 +11,7 @@ class Network::DnsController < ApplicationController > def update > root = params[:dns] > if root == nil > - render ErrorResult.error(404, 2, "format or internal error") and > return + raise InvalidParameters.new [{:name => "Dns", :error => > "Missing"}] end > > root["searches"]=root["searches"].split > diff --git a/plugins/network/app/controllers/network/hostname_controller.rb > b/plugins/network/app/controllers/network/hostname_controller.rb index > cd85d66..86c51d3 100644 > --- a/plugins/network/app/controllers/network/hostname_controller.rb > +++ b/plugins/network/app/controllers/network/hostname_controller.rb > @@ -12,7 +12,7 @@ class Network::HostnameController < ApplicationController > def update > root = params[:hostname] > if root == nil > - render ErrorResult.error(404, 2, "format or internal error") and > return + raise InvalidParameters.new [{:name => "Hostname", :error => > "Missing"}] end > > @hostname = Hostname.new(root) > diff --git > a/plugins/network/app/controllers/network/interfaces_controller.rb > b/plugins/network/app/controllers/network/interfaces_controller.rb index > 5571039..a377a09 100644 > --- a/plugins/network/app/controllers/network/interfaces_controller.rb > +++ b/plugins/network/app/controllers/network/interfaces_controller.rb > @@ -11,7 +11,7 @@ class Network::InterfacesController < > ApplicationController def update > root = params[:interfaces] > if root == nil > - render ErrorResult.error(404, 2, "format or internal error") and > return + raise InvalidParameters.new [{:name => "Interfaces", :error > => "Missing"}] end > > @iface = Interface.new(root) > diff --git a/plugins/network/app/controllers/network/routes_controller.rb > b/plugins/network/app/controllers/network/routes_controller.rb index > 571d132..011620a 100644 > --- a/plugins/network/app/controllers/network/routes_controller.rb > +++ b/plugins/network/app/controllers/network/routes_controller.rb > @@ -11,7 +11,7 @@ class Network::RoutesController < ApplicationController > def update > root = params[:routes] > if root == nil > - render ErrorResult.error(404, 2, "format or internal error") and > return + raise InvalidParameters.new [{:name => "Routes", :error => > "Missing"}] end > @route = Route.find(root[:id]) > @route.via = root[:via] >
Hi, just note, that you don't need set name to humanized string, I already do it, so just name parameter like if routes is not set, then you can set name to "routes" -- Josef Reidinger YaST team maintainer of perl-Bootloader, YaST2-Repair, webyast modules language and time -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
