Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] <rest-service> jr_ntp : change implementation to match Error reporting structure of ActiveResource
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Mon, 21 Sep 2009 11:22:28 +0200
  • Message-id: <E1MpkqY-0005Cs-Gr@xxxxxxxxxxxxxxxx>
ref: refs/heads/jr_ntp
commit b124b4609e536320def9cc09dd0fef4b6683c4e6
Author: Josef Reidinger <jreidinger@xxxxxxx>
Date: Mon Sep 21 11:16:07 2009 +0200

change implementation to match Error reporting structure of ActiveResource
---
webservice/lib/exceptions.rb | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/webservice/lib/exceptions.rb b/webservice/lib/exceptions.rb
index c932852..1f2abc1 100644
--- a/webservice/lib/exceptions.rb
+++ b/webservice/lib/exceptions.rb
@@ -42,7 +42,7 @@ class InvalidParameters < ArgumentError
end

# Creates standartized xml for ActiveResource validation -
http://railsbrain.com/api/rails-2.3.2/doc/index.html?a=C00000626&name=Base
- # error is reported in format 'Invalid: <argument name> --- <error
identificator>
+ # error is reported in format '<humanized argument name> --- <error
identificator>
def to_xml()
xml = Builder::XmlMarkup.new(options)
xml.instruct! unless options[:skip_instruct]
@@ -50,7 +50,7 @@ class InvalidParameters < ArgumentError
xml.errors(:type => "array") do
@constrains.each {
|c|
- xml.error "Invalid: #{c[:name]} --- #{c[:error]}"
+ xml.error "#{c[:name].humanize} --- #{c[:error]}"
}
end
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