Re: auditor raises an exception
Tom Ekberg <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.user |
|---|---|
| Message-ID | <[email protected]> |
Ralf, Thanks for confirming that it should display a message to the user. I had changed exception handling to handle detector errors better. My bad. In hyperdb.py Class.fireAuditors it now catches ValueError and Reject exceptions, and rethrows them. Other exceptions will generate a stack trace, display 'An error has occurred' to the user, and send an email to roundup-admin. Now the prohibited characters error message is displayed to the user. Tom Ekberg Senior Computer Specialist, Lab Medicine University of Washington Medical Center 1959 NE Pacific St, MS 357110 Seattle WA 98195 cell: (253) 561-2509 email: [email protected] On Thu, 30 Jan 2014, Ralf Schlatterbeck wrote: > Date: Thu, 30 Jan 2014 08:44:20 +0100 > From: Ralf Schlatterbeck <[email protected]> > To: Tom Ekberg <[email protected]> > Cc: [email protected] > Subject: Re: [Roundup-users] auditor raises an exception > > 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