Tuesday, March 2, 2021
3 changes · master
Resolved issues and error corrections
This fix makes error details generated in Firefox easier for Odoo to read and display correctly. It helps support and technical teams diagnose template-related issues more reliably without changing normal user workflows.
Original PR description
In Firefox, the error stack generated by anonymous code (example: erroneous code in a template) is not compatible with the stacktrace lib. The error stack could contain lines like : "anonymous…
In Firefox, the error stack generated by anonymous code (example:
erroneous code in a template) is not compatible with the stacktrace lib.
The error stack could contain lines like :
"anonymous web.assets_common.js line 9786 > Function:442".
In order to make it usable by the stacktrace lib, we will remove
the words "lines", ">", "Function:442" to get:
"anonymous owl.js:1695".
Traceback:
Before:
Error: QWeb error: Invalid loop expression
anonymous web.assets_common.js line 9786 > Function:442
fn owl.js:1567
render owl.js:1617
renderFn owl.js:4595
__render owl.js:4391
__prepareAndRender owl.js:4379
__prepare owl.js:4325
anonymous web.assets_common.js line 9786 > Function:175
...
After:
Error: QWeb error: Invalid loop expression
anonymous owl.js:1695
fn owl.js:1567
render owl.js:1617
renderFn owl.js:4595
__render owl.js:4391
__prepareAndRender owl.js:4379
__prepare owl.js:4325
anonymous owl.js:1695
...This fix improves how error details are shown when developers investigate problems in debug assets mode. Failed background actions now keep the original error information, making issues easier to diagnose and resolve faster.
Original PR description
A previous commit (934e0896160272542dd00) modified QUnit to make sure we can display better tracebacks in debug=assets mode. However, this commit did not apply to errors coming from failing promises. To fix this, we can simply keep a reference to the error in that specific case. Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Fixes a problem where error reporting could get stuck in a repeated failure loop on non-Chrome browsers. This helps keep the web interface stable when errors occur, instead of potentially causing the browser to crash.
Original PR description
The formatTraceback function relies on _t to add the error message to tracebacks, it was recently moved around while refactoring but it seems that its dependency was forgotten and not imported. This causes the attempt to call _t to crash, which will try to format the error, which will again try to call _t and crash, until the browser itself crashes. This commit fixes that issue by adding the required import.