This commit adds a 'guardedCatch' function to the Promise API. This function has to be used when we don't want to swallow real errors (crashes), like 'catch' does (i.e. basically all the time in Odoo). When the promise has been rejected because of a real error, the rejected Promises chain bubbles up to the top and triggers the 'unhandledrejection' event (triggered on all browsers thanks to the unhandled-rejection-polyfill lib). We then add a listener on that event to display real errors with the CrashManager. Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>