Mailinglist Archive: yast-devel (163 mails)

< Previous Next >
[yast-devel] Error handling - rest service side
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Thu, 03 Sep 2009 10:22:10 +0200
  • Message-id: <4A9F7CB2.5030709@xxxxxxx>
as you can see from commits I merge my error handling branch to master.
So what changes:
in short:
errors in backend is reported via exceptions, all webservice exceptions
should have one ancestor BackendException, so if you want add own
exception please create it as child of this class
uncatched BackendExceptions is reported as 503 and content is xml
description of problem.
BackendException must have unique enum identificator, english
description if anyone read directly xml and to_xml method, that creates
content of respond.
I create 3 exceptions for permission check as example, so now
permission_check method throws exceptions instead returning false and if
you don't want return something special, don't catch it.
For yapi based modules I create shortcut yapi_perm_check where you only
specify last part of permission (e.g. "") more in yast_roles

Duncan - can we generate documentation on some public place to easier
link it and be easier accesible?

Welcome any comments and I suggest create own exceptions. I plan in near
future addapt client side error reporting for this 503 response.

Documented also on wiki

Welcome any comments and suggestions
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