Mailinglist Archive: yast-devel (163 mails)

< Previous Next >
[yast-devel] WebYast: Error reporting in backend and how to use it in plugin
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Mon, 21 Sep 2009 11:35:46 +0200
  • Message-id: <4AB748F2.3090406@xxxxxxx>
I done error reporting in backend based on exceptions (Universal
exceptions is in file exceptions in webservice/lib).
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. After you throw it, then if you don't
catch it, it response 422 and use Error reporting structure for
ActiveResource. So it return false on ActiveResource#save see
ActiveResource::Base documentation for details (section validations errors).
Second is problem on target machine like missing file, failed call of
script, missing permissions etc. For this case exist ancestor
BackendError which if not catched response 503 and serialized xml with
description of problem (exceptions.rb contains few child for
inspiration). If you don't catch error on frontend it end up in error
reporting page which print error. For translated error is neccesarry to
add translated string to ErrorConstructor module in libs directory at
frontend (see already translated messages for usage).

If you have any question, suggestion or problem please say it

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 >
Follow Ups