diff roundup/cgi/client.py @ 8253:cae1bbf2536b

fix: issue2551374 - Add error handling for filter expressions. Fix UI Errors are now reported using the search template. This should work in most situations. However if the query was generated using an alternate search template, the user may not be able to fix it. I'm not sure how to tell what template was used to submit the search. By the time I handle the error, I don't think I have access to an ok template or error template. Might need to add a new field if this becomes a problem. Also fixed a couple of tests changing the status code to 200 from 400 since we aren't on an error page anymore. Updated user_guide including 3 sample error messages for search expressions and how to understand them.
author John Rouillard <rouilj@ieee.org>
date Wed, 01 Jan 2025 02:06:00 -0500
parents 6747051fef79
children 28c5030757d3
line wrap: on
line diff
--- a/roundup/cgi/client.py	Wed Jan 01 01:02:09 2025 -0500
+++ b/roundup/cgi/client.py	Wed Jan 01 02:06:00 2025 -0500
@@ -2232,7 +2232,8 @@
                 result = self.renderError(e.args[0])
             except ExpressionError as e:
                 self.add_error_message(str(e))
-                result = self.renderError(str(e))
+                self.template = "search"
+                self.write_html(self.renderContext())
 
             if 'Content-Type' not in self.additional_headers:
                 self.additional_headers['Content-Type'] = pt.content_type

Roundup Issue Tracker: http://roundup-tracker.org/