Skip to content

Commit 6768b83

Browse files
committed
chore: demo
1 parent c13f311 commit 6768b83

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

demo-vue/.sentryclirc

Lines changed: 0 additions & 7 deletions
This file was deleted.

demo-vue/app/App_Resources/iOS/src/TestClass.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
@interface TestClass: NSObject
44

55
+(void)someMethod;
6+
+(void)helloWorld: (NSString* ) message;
67

78
@end

demo-vue/app/App_Resources/iOS/src/TestClass.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@ +(void)someMethod {
88
NSLog(@"%@", result);
99
}
1010

11+
12+
+(void)helloWorld: (NSString* ) message {
13+
@throw [NSException exceptionWithName:message
14+
reason:@"reason"
15+
userInfo:nil];
16+
}
1117
@end

demo-vue/app/views/Home.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { TextEncoder } from '@nativescript/core/text';
44
import { createArrayBuffer } from '@nativescript-community/arraybuffers';
55
declare class TestClass {
66
static someMethod();
7+
static helloWorld(str: string);
78
}
89

910
export default {
@@ -85,7 +86,7 @@ export default {
8586
});
8687
},
8788
throwError() {
88-
89+
8990
Sentry.captureException(new Error('test_notify_error' + Date.now()));
9091
},
9192
leaveBreadcrumb() {
@@ -99,8 +100,12 @@ export default {
99100
},
100101
androidNativeCrashCatchedTest() {
101102
try {
102-
console.log('androidNativeCrashTest', (com as any).nativescript.sentry.ClassExample.helloWorld('test3'));
103-
103+
if (__ANDROID__) {
104+
console.log('androidNativeCrashTest', (com as any).nativescript.sentry.ClassExample.helloWorld('test3'));
105+
}
106+
if(__IOS__) {
107+
console.log('iosNativeCrashTest', TestClass.helloWorld('test3'));
108+
}
104109
} catch (error) {
105110
// console.error('error', error);
106111
// console.error('keys', Object.keys(error));
@@ -113,7 +118,12 @@ export default {
113118
}
114119
},
115120
androidNativeCrashTest() {
116-
console.log('androidNativeCrashTest', (com as any).nativescript.sentry.ClassExample.helloWorld('test3'));
121+
if (__ANDROID__) {
122+
console.log('androidNativeCrashTest', (com as any).nativescript.sentry.ClassExample.helloWorld('test3'));
123+
}
124+
if(__IOS__) {
125+
console.log('iosNativeCrashTest', TestClass.helloWorld('test3'));
126+
}
117127
},
118128
flush() {
119129
Sentry.flush();

0 commit comments

Comments
 (0)