mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
fix(overlays): thrown errors are no longer suppressed (#23831)
resolves #22724
This commit is contained in:
@ -528,6 +528,13 @@ export const isCancel = (role: string | undefined): boolean => {
|
|||||||
|
|
||||||
const defaultGate = (h: any) => h();
|
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) => {
|
export const safeCall = (handler: any, arg?: any) => {
|
||||||
if (typeof handler === 'function') {
|
if (typeof handler === 'function') {
|
||||||
const jmp = config.get('_zoneGate', defaultGate);
|
const jmp = config.get('_zoneGate', defaultGate);
|
||||||
@ -535,7 +542,7 @@ export const safeCall = (handler: any, arg?: any) => {
|
|||||||
try {
|
try {
|
||||||
return handler(arg);
|
return handler(arg);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
throw e;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user