Mercurial > p > roundup > code
diff roundup/cgi/client.py @ 5666:d660d1c1ba63
Handle LoginError in rest code. Stop standard "an error occurred check
server log for details" error message from making it to the user.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Fri, 22 Mar 2019 23:59:02 -0400 |
| parents | 7e1b2a723253 |
| children | f60c44563c3a |
line wrap: on
line diff
--- a/roundup/cgi/client.py Fri Mar 22 18:16:11 2019 -0400 +++ b/roundup/cgi/client.py Fri Mar 22 23:59:02 2019 -0400 @@ -527,7 +527,16 @@ self.determine_language() # Open the database as the correct user. # TODO: add everything to RestfulDispatcher - self.determine_user() + try: + self.determine_user() + except LoginError as err: + self.response_code = http_.client.UNAUTHORIZED + output = b"Invalid Login\n" + self.setHeader("Content-Length", str(len(output))) + self.setHeader("Content-Type", "text/plain") + self.write(output) + return + self.check_anonymous_access() # Call rest library to handle the request
