mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[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:
@@ -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) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user