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 <[email protected]> SUSE Linux Products GmbH Research & Development Maxfeldstr. 5 GF: Markus Rex, HRB 16746 (AG Nürnberg) D-90409 Nürnberg -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
