[IMP] web: log error when generating a report fails
For reports fetched through this endpoint, the error would only be reported to the client, which may well ignore it entirely (e.g. show a completely generic message which might as well be unhelpful and at worst aggressively misleading). Log the error locally before returning it to the client, so the info is at least in the logs. closes odoo/odoo#57411 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit is contained in:
@@ -2071,6 +2071,7 @@ class ReportController(http.Controller):
|
||||
"""
|
||||
requestcontent = json.loads(data)
|
||||
url, type = requestcontent[0], requestcontent[1]
|
||||
reportname = '???'
|
||||
try:
|
||||
if type in ['qweb-pdf', 'qweb-text']:
|
||||
converter = 'pdf' if type == 'qweb-pdf' else 'text'
|
||||
@@ -2109,6 +2110,7 @@ class ReportController(http.Controller):
|
||||
else:
|
||||
return
|
||||
except Exception as e:
|
||||
_logger.exception("Error while generating report %s", reportname)
|
||||
se = _serialize_exception(e)
|
||||
error = {
|
||||
'code': 200,
|
||||
|
||||
Reference in New Issue
Block a user