Mailinglist Archive: yast-devel (233 mails)

< Previous Next >
Re: [yast-devel] Re: [yast-commit] <rest-service> master : add json support, small fixes in controllers, cleanup
  • From: "J. Daniel Schmidt" <jdsn@xxxxxxx>
  • Date: Mon, 19 Oct 2009 13:53:52 +0200
  • Message-id: <200910191353.52670.jdsn@xxxxxxx>
On Thursday 15 October 2009 09:53:39 Martin Vidner wrote:
On Wed, Oct 14, 2009 at 07:19:38PM +0200, J.Daniel Schmidt wrote:
.../app/controllers/configuration_controller.rb | 42
ret = @registration.register
+ headers["Status"] = "400 Bad Request" if ret == 3

Is the intent to report to the upper layers (UI) that the lower
layer (YaPI) encountered invalid data? Then you are supposed to
raise InvalidParameters.new :some_item => "Missing"
http://lists.opensuse.org/yast-devel/2009-09/msg00117.html


No, the intent is to give the client the possibility to access the data that
the rest service returns. A status called "missing data" is a valid state and
I returned 200 always together with the body. But then Stefan complained that
he can not access the returned body data in the client module.

Thus I create an error 400 for all states != 0 (for testing it was only in
case of 3). Then the client can access the body and evaluate it. I think
Schubi can tell more about that.

If you have any recommendation how to improve it, it will be welcome.


Ciao,
Daniel

--
J. Daniel Schmidt <jdsn@xxxxxxx> SUSE Linux Products GmbH
Research & Development Maxfeldstr. 5
GF: Markus Rex, HRB 16746 (AG Nürnberg) D-90409 Nürnberg
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
References