[13.0][ENH]ebics init_1 extra diagnostics

This commit is contained in:
Luc De Meyer 2020-07-19 11:38:08 +02:00
parent df4c65f205
commit 54f400ef96
2 changed files with 17 additions and 3 deletions

View File

@ -3,7 +3,7 @@
{ {
'name': 'EBICS banking protocol', 'name': 'EBICS banking protocol',
'version': '13.0.1.1.1', 'version': '13.0.1.1.2',
'license': 'LGPL-3', 'license': 'LGPL-3',
'author': 'Noviat', 'author': 'Noviat',
'website': 'www.noviat.com', 'website': 'www.noviat.com',

View File

@ -5,6 +5,7 @@ import base64
import logging import logging
import os import os
from sys import exc_info from sys import exc_info
from traceback import format_exception
from urllib.error import URLError from urllib.error import URLError
from odoo import _, api, fields, models from odoo import _, api, fields, models
@ -12,6 +13,14 @@ from odoo.exceptions import UserError
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
"""
logging.basicConfig(
level=logging.DEBUG,
format='[%(asctime)s] %(levelname)s - %(name)s: %(message)s')
"""
try: try:
import fintech import fintech
from fintech.ebics import EbicsKeyRing, EbicsBank, EbicsUser,\ from fintech.ebics import EbicsKeyRing, EbicsBank, EbicsUser,\
@ -171,7 +180,6 @@ class EbicsUserID(models.Model):
if not self.ebics_passphrase: if not self.ebics_passphrase:
raise UserError( raise UserError(
_("Set a passphrase.")) _("Set a passphrase."))
try: try:
keyring = EbicsKeyRing( keyring = EbicsKeyRing(
keys=self.ebics_keys_fn, keys=self.ebics_keys_fn,
@ -229,9 +237,15 @@ class EbicsUserID(models.Model):
self.ebics_config_id._update_order_number(OrderID) self.ebics_config_id._update_order_number(OrderID)
except URLError: except URLError:
exctype, value = exc_info()[:2] exctype, value = exc_info()[:2]
tb = "".join(format_exception(*exc_info()))
_logger.error(
"EBICS INI command error\nUserID: %s\n%s",
self.name,
tb,
)
raise UserError(_( raise UserError(_(
"urlopen error:\n url '%s' - %s") "urlopen error:\n url '%s' - %s")
% (self.ebics_url, str(value))) % (self.ebics_config_id.ebics_url, str(value)))
except EbicsFunctionalError: except EbicsFunctionalError:
e = exc_info() e = exc_info()
error = _("EBICS Functional Error:") error = _("EBICS Functional Error:")