octicon-rss(16/)
You've already forked ionic-framework
mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(overlays): thrown errors are no longer suppressed (#23831)
resolves #22724
This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
committed by
GitHub
gitea-unlock(16/)
parent
1d2ee92ca0
commit
a212eb5259
octicon-diff(16/tw-mr-1) 1 changed files with 8 additions and 1 deletions
@@ -528,6 +528,13 @@ export const isCancel = (role: string | undefined): boolean => {
|
||||
|
||||
const defaultGate = (h: any) => h();
|
||||
|
||||
/**
|
||||
* Calls a developer provided method while avoiding
|
||||
* Angular Zones. Since the handler is provided by
|
||||
* the developer, we should throw any errors
|
||||
* received so that developer-provided bug
|
||||
* tracking software can log it.
|
||||
*/
|
||||
export const safeCall = (handler: any, arg?: any) => {
|
||||
if (typeof handler === 'function') {
|
||||
const jmp = config.get('_zoneGate', defaultGate);
|
||||
@@ -535,7 +542,7 @@ export const safeCall = (handler: any, arg?: any) => {
|
||||
try {
|
||||
return handler(arg);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user