fix: replace bare raise statement with AuthenticationError in oauth.py (#36729)
* fix: replace bare raise statement with AuthenticationError in oauth.py * fix: add error log
This commit is contained in:
parent
db9a4e9086
commit
b39800e5aa
1 changed files with 10 additions and 1 deletions
|
|
@ -65,7 +65,16 @@ class Oauth:
|
||||||
)
|
)
|
||||||
|
|
||||||
if not res.startswith(b"+OK"):
|
if not res.startswith(b"+OK"):
|
||||||
raise
|
frappe.log_error(
|
||||||
|
title="POP3 OAuth Authentication Failed",
|
||||||
|
message=f"Response: {res}",
|
||||||
|
reference_doctype="Email Account",
|
||||||
|
reference_name=self.email_account,
|
||||||
|
)
|
||||||
|
frappe.throw(
|
||||||
|
frappe._("POP3 OAuth authentication failed for Email Account {0}").format(self.email_account),
|
||||||
|
frappe.AuthenticationError,
|
||||||
|
)
|
||||||
|
|
||||||
def _connect_imap(self) -> None:
|
def _connect_imap(self) -> None:
|
||||||
self._conn.authenticate(self._mechanism, lambda x: self._auth_string)
|
self._conn.authenticate(self._mechanism, lambda x: self._auth_string)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue