mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(core): unhandled error typings (#10320)
NativeScriptError type def used to come from packages/core/global-types.d.ts now comes from packages/core/application/application-interfaces.ts, so fixed there now.
This commit is contained in:
@@ -80,14 +80,14 @@ Application.on(Application.lowMemoryEvent, function (args: ApplicationEventData)
|
||||
// Error events.
|
||||
Application.on(Application.uncaughtErrorEvent, function (args: UnhandledErrorEventData) {
|
||||
console.log('NativeScriptError:', args.error);
|
||||
console.log((<any>args.error).nativeException ?? (<any>args.error).nativeError);
|
||||
console.log((<any>args.error).stackTrace ?? (<any>args.error).stack);
|
||||
console.log(args.error.nativeException ?? (<any>args.error).nativeError);
|
||||
console.log(args.error.stackTrace ?? args.error.stack);
|
||||
});
|
||||
|
||||
Application.on(Application.discardedErrorEvent, function (args: DiscardedErrorEventData) {
|
||||
console.log('[Discarded] NativeScriptError:', args.error);
|
||||
console.log((<any>args.error).nativeException ?? (<any>args.error).nativeError);
|
||||
console.log((<any>args.error).stackTrace ?? (<any>args.error).stack);
|
||||
console.log(args.error.nativeException ?? (<any>args.error).nativeError);
|
||||
console.log(args.error.stackTrace ?? args.error.stack);
|
||||
});
|
||||
|
||||
// Android activity events.
|
||||
|
||||
@@ -9,7 +9,15 @@ export interface NativeScriptError extends Error {
|
||||
/**
|
||||
* Represents the native error object.
|
||||
*/
|
||||
nativeError: any;
|
||||
nativeException?: any;
|
||||
/**
|
||||
* The native stack trace.
|
||||
*/
|
||||
stackTrace?: string;
|
||||
/**
|
||||
* Javascript portion of stack trace.
|
||||
*/
|
||||
stack?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user