File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
platform-includes/capture-error Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,12 @@ enum MyCustomError: Error {
77 case myFirstIssue
88}
99
10- func thisFunctionWillThrow () throws {
10+ func thisFunctionThrows () throws {
1111 throw MyCustomError.myFirstIssue
1212}
1313
1414do {
15- try thisFunctionWillThrow ()
15+ try thisFunctionThrows ()
1616} catch {
1717 SentrySDK.capture (error : error)
1818}
2121``` objc {tabTitle:Objective-C}
2222@import Sentry;
2323
24- - (void )thisFunctionWillReturnAnError :(NSError **)error {
24+ - (void )thisFunctionReturnsAnError :(NSError **)error {
2525 * error = [ NSError errorWithDomain:@"com.example.myapp"
2626 code:1001
2727 userInfo:@{
2828 NSLocalizedDescriptionKey : @" Something went wrong."
2929 } ] ;
3030}
31+
3132// ... Your code
3233
3334NSError *error = nil ;
34- [self thisFunctionWillReturnAnError : &error] ;
35+ [self thisFunctionReturnsAnError : &error] ;
3536
3637if (error) {
3738 [SentrySDK captureError :error ];
You can’t perform that action at this time.
0 commit comments