Mailinglist Archive: yast-devel (163 mails)

< Previous Next >
[yast-devel] Re: [yast-commit] <rest-service> network : Added a note to s/404/422/ in test_update_noparams.
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Tue, 15 Sep 2009 14:43:09 +0200
  • Message-id: <4AAF8BDD.8000201@xxxxxxx>
Martin Vidner wrote:
ref: refs/heads/network
commit 95f714b375f3dadfb35060427a0280c8a9f04bc6
Author: Martin Vidner <mvidner@xxxxxxx>
Date: Tue Sep 15 13:13:48 2009 +0200

Added a note to s/404/422/ in test_update_noparams.
---
webservice/test/plugin_basic_tests.rb | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/webservice/test/plugin_basic_tests.rb
b/webservice/test/plugin_basic_tests.rb
index f77ffb7..11907cd 100644
--- a/webservice/test/plugin_basic_tests.rb
+++ b/webservice/test/plugin_basic_tests.rb
@@ -66,6 +66,8 @@ module PluginBasicTests
def test_update_noparams
@model_class.stubs(:save)
put :update
+ # FIXME: it is not 404, but 422 unprocessable entity,
+ # see "Validation errors" in
http://api.rubyonrails.org/classes/ActiveResource/Base.html
assert_response :missing
end


Hi, I think that this is one of thinks when we should use our new error
reporting in backend. So I prefer throwing exception where is defined
what parameter is invalid or missing (due to rest service should be used
without webclient).

I prefer solution with exception because it provide better description
of problem and also it is easier to handle in frontend.

Any reason why not use exceptions?
Josef

--
Josef Reidinger
YaST team
maintainer of perl-Bootloader, YaST2-Repair, webyast modules language
and time
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages