[FIX] component: do not shadow the initial error in some cases

Before this commit, the error handling code simply destroyed the
application whenever an unhandled error occured in the owl rendering
process. This is perfectly fine, except that since the application is
potentially corrupted, the destroy code may crash as well. We simply
catch those errors to avoid shadowing the main issue.

closes #866
This commit is contained in:
Géry Debongnie
2021-07-03 15:34:20 +02:00
committed by aab-odoo
parent a6bb4d8ee1
commit 3a93370ab6
2 changed files with 29 additions and 1 deletions
+8 -1
View File
@@ -355,7 +355,14 @@ export class Fiber {
this.root.counter = 0;
this.root.error = error;
scheduler.flush();
root.destroy();
// at this point, the state of the application is corrupted and we could
// have a lot of issues or crashes. So we destroy the application in a try
// catch and swallow these errors because the fiber is already in error,
// and this is the actual issue that needs to be solved, not those followup
// errors.
try {
root.destroy();
} catch (e) {}
}
}
}