Re: auditor raises an exception

Ralf Schlatterbeck <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.user
Message-ID <[email protected]>
On Wed, Jan 29, 2014 at 10:51:13AM -0800, Tom Ekberg wrote:
> I wrote an auditor that checks to make sure that certain prohibited
> characters are not present. The code works fine, except that when the
> check finds prohibited characters it has to raise an exception
> (Reject) to indicate failure. The user is presented with a 'An error
> has occurred' page, and I, as the admin, get an email with the stack
> trace. What I'd like is to have the user shown the error, similar to
> what happens when a user fails to enter data in a required field. Is
> it possible to hook into that part of roundup, or should I raise a
> different exception? I have tried Reject and ValueError - both send me
> the stack trace and show the user the 'An error has occurred' page.

Can you show us the code?
Raising a Reject in an auditor (not in a reactor which runs *after* the
datebase is updated) should give you a nice error message in the web
interface, same for ValueError (for historical reasons in the ancient
past of roundup).

Ralf
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   http://www.runtux.com
Reichergasse 131, A-3411 Weidling       email: [email protected]
allmenda.com member                     email: [email protected]

------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.