On Mon, Sep 21, 2009 at 11:35:46AM +0200, Josef Reidinger wrote:
Hi, I done error reporting in backend based on exceptions (Universal exceptions is in file exceptions in webservice/lib).
Thanks! Here comes the punishment ;-)
There is two type of error: First is invalid or missing parameters. For this case exist InvalidParameters exceptions. For example usage and details please see documentation of this exceptions.
ENOURL! http://git.opensuse.org/?p=projects/yast/rest-service.git;a=blob;f=webservic... So as an example, which everyone will need to copy: http://git.opensuse.org/?p=projects/yast/rest-service.git;a=commitdiff;h=b7f... root = params[:time] if root == nil - render ErrorResult.error(404, 2, "format or internal error") and return + raise InvalidParameters.new [{:name => "Timezone", :error => "Missing"}] end Why is it "Timezone" instead of "time"? AFAIK :name is supposed to be the missing attribute, but here the entire record is missing. Should it not be added to the "base"? (And I don't like the need to specify an array explicitly, but I can fix that later.) -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org