Skip to content

Commit

Permalink
Raise "Not found" error when trying to login to unknown database
Browse files Browse the repository at this point in the history
issue11801
review418411003
  • Loading branch information
cedk committed Oct 21, 2022
1 parent 262c111 commit 97be1cc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tryton/common/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,8 @@ def process_exception(exception, *args, **kwargs):
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:
Expand Down Expand Up @@ -1098,6 +1100,10 @@ def __init__(self, func=rpc.login):
_('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
Expand Down

0 comments on commit 97be1cc

Please sign in to comment.