changeset 7144cfe9287e in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset&node=7144cfe9287e
description:
        Raise "Not found" error when trying to login to unknown database

        issue11801
        review418411003
diffstat:

 tryton/common/common.py |  6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diffs (23 lines):

diff -r 31bbeeda023b -r 7144cfe9287e tryton/common/common.py
--- a/tryton/common/common.py   Sun Oct 16 14:14:13 2022 +0200
+++ b/tryton/common/common.py   Sat Oct 22 00:58:28 2022 +0200
@@ -1021,6 +1021,8 @@
             message(
                 _('Too many requests. Try again later.'),
                 msg_type=Gtk.MessageType.ERROR)
+        elif exception.faultCode == str(int(HTTPStatus.NOT_FOUND)):
+            message(_("Not found."), msg_type=Gtk.MessageType.ERROR)
         else:
             error(exception, exception.faultString)
     else:
@@ -1098,6 +1100,10 @@
                         _('Too many requests. Try again later.'),
                         msg_type=Gtk.MessageType.ERROR)
                     continue
+                elif (exception.faultCode
+                        == str(int(HTTPStatus.NOT_FOUND))):
+                    message(_("Not Found."), msg_type=Gtk.MessageType.ERROR)
+                    raise TrytonError('QueryCanceled')
                 if exception.faultCode != 'LoginException':
                     raise
                 name, msg, type = exception.args

Reply via email to