diff --git a/addons/auth_totp_mail_enforce/controllers/home.py b/addons/auth_totp_mail_enforce/controllers/home.py index 64f19470029..795199da175 100644 --- a/addons/auth_totp_mail_enforce/controllers/home.py +++ b/addons/auth_totp_mail_enforce/controllers/home.py @@ -1,10 +1,13 @@ # -*- coding: utf-8 -*- +import logging import odoo.addons.auth_totp.controllers.home from odoo import http from odoo.exceptions import AccessDenied, UserError from odoo.http import request +_logger = logging.getLogger(__name__) + class Home(odoo.addons.auth_totp.controllers.home.Home): @http.route() @@ -22,5 +25,7 @@ class Home(odoo.addons.auth_totp.controllers.home.Home): response.qcontext['user']._send_totp_mail_code() except (AccessDenied, UserError) as e: response.qcontext['error'] = str(e) - + except Exception as e: + _logger.exception('Unable to send TOTP email') + response.qcontext['error'] = str(e) return response