@@ -506,13 +506,13 @@ - (void)testIgnoreErrorsDropsMatchingExceptionValue
506
506
NSError *error = nil ;
507
507
NSDictionary *mockedOptions = @{
508
508
@" dsn" :
@" https://[email protected] /1234567" ,
509
- @" ignoreErrors " : @[ @" IgnoreMe.*" ]
509
+ @" ignoreErrorsRegex " : @[ @" IgnoreMe.*" ]
510
510
};
511
511
SentryOptions *options = [rnSentry createOptionsWithDictionary: mockedOptions error: &error];
512
512
XCTAssertNotNil (options);
513
513
XCTAssertNil (error);
514
514
SentryEvent *event = [[SentryEvent alloc ] init ];
515
- SentryException *exception = [[ SentryException alloc ] init ];
515
+ SentryException *exception = [SentryException alloc ];
516
516
exception.value = @" IgnoreMe: This should be ignored" ;
517
517
event.exceptions = @[ exception ];
518
518
SentryEvent *result = options.beforeSend (event);
@@ -525,14 +525,14 @@ - (void)testIgnoreErrorsDropsMatchingEventMessage
525
525
NSError *error = nil ;
526
526
NSDictionary *mockedOptions = @{
527
527
@" dsn" :
@" https://[email protected] /1234567" ,
528
- @" ignoreErrors " : @[ @" DropThisError" ]
528
+ @" ignoreErrorsStr " : @[ @" DropThisError" ]
529
529
};
530
530
SentryOptions *options = [rnSentry createOptionsWithDictionary: mockedOptions error: &error];
531
531
XCTAssertNotNil (options);
532
532
XCTAssertNil (error);
533
533
SentryEvent *event = [[SentryEvent alloc ] init ];
534
- SentryMessage *msg = [[ SentryMessage alloc ] init ] ;
535
- msg.formatted = @" DropThisError: should be dropped" ;
534
+ SentryMessage *msg = [SentryMessage alloc ] ;
535
+ msg.message = @" DropThisError: should be dropped" ;
536
536
event.message = msg;
537
537
SentryEvent *result = options.beforeSend (event);
538
538
XCTAssertNil (result, @" Event with matching event.message.formatted should be dropped" );
@@ -544,17 +544,17 @@ - (void)testIgnoreErrorsDoesNotDropNonMatchingEvent
544
544
NSError *error = nil ;
545
545
NSDictionary *mockedOptions = @{
546
546
@" dsn" :
@" https://[email protected] /1234567" ,
547
- @" ignoreErrors " : @[ @" IgnoreMe.*" ]
547
+ @" ignoreErrorsRegex " : @[ @" IgnoreMe.*" ]
548
548
};
549
549
SentryOptions *options = [rnSentry createOptionsWithDictionary: mockedOptions error: &error];
550
550
XCTAssertNotNil (options);
551
551
XCTAssertNil (error);
552
552
SentryEvent *event = [[SentryEvent alloc ] init ];
553
- SentryException *exception = [[ SentryException alloc ] init ];
553
+ SentryException *exception = [SentryException alloc ];
554
554
exception.value = @" SomeOtherError: should not be ignored" ;
555
555
event.exceptions = @[ exception ];
556
- SentryMessage *msg = [[ SentryMessage alloc ] init ];
557
- msg.formatted = @" SomeOtherMessage" ;
556
+ SentryMessage *msg = [SentryMessage alloc ];
557
+ msg.message = @" SomeOtherMessage" ;
558
558
event.message = msg;
559
559
SentryEvent *result = options.beforeSend (event);
560
560
XCTAssertNotNil (result, @" Event with non-matching error should not be dropped" );
@@ -566,14 +566,14 @@ - (void)testIgnoreErrorsDropsMatchingExactString
566
566
NSError *error = nil ;
567
567
NSDictionary *mockedOptions = @{
568
568
@" dsn" :
@" https://[email protected] /1234567" ,
569
- @" ignoreErrors " : @[ @" ExactError" ]
569
+ @" ignoreErrorsStr " : @[ @" ExactError" ]
570
570
};
571
571
SentryOptions *options = [rnSentry createOptionsWithDictionary: mockedOptions error: &error];
572
572
XCTAssertNotNil (options);
573
573
XCTAssertNil (error);
574
574
SentryEvent *event = [[SentryEvent alloc ] init ];
575
- SentryMessage *msg = [[ SentryMessage alloc ] init ];
576
- msg.formatted = @" ExactError" ;
575
+ SentryMessage *msg = [SentryMessage alloc ];
576
+ msg.message = @" ExactError" ;
577
577
event.message = msg;
578
578
SentryEvent *result = options.beforeSend (event);
579
579
XCTAssertNil (result, @" Event with exactly matching string should be dropped" );
@@ -585,29 +585,31 @@ - (void)testIgnoreErrorsRegexAndStringBothWork
585
585
NSError *error = nil ;
586
586
NSDictionary *mockedOptions = @{
587
587
@" dsn" :
@" https://[email protected] /1234567" ,
588
- @" ignoreErrors" : @[ @" ExactError" , @" IgnoreMe.*" ]
588
+ @" ignoreErrorsStr" : @[ @" ExactError" ],
589
+ @" ignoreErrorsRegex" : @[ @" IgnoreMe.*" ],
590
+
589
591
};
590
592
SentryOptions *options = [rnSentry createOptionsWithDictionary: mockedOptions error: &error];
591
593
XCTAssertNotNil (options);
592
594
XCTAssertNil (error);
593
595
// Test regex match
594
596
SentryEvent *event1 = [[SentryEvent alloc ] init ];
595
- SentryException *exception = [[ SentryException alloc ] init ];
597
+ SentryException *exception = [SentryException alloc ];
596
598
exception.value = @" IgnoreMe: This should be ignored" ;
597
599
event1.exceptions = @[ exception ];
598
600
SentryEvent *result1 = options.beforeSend (event1);
599
601
XCTAssertNil (result1, @" Event with matching regex should be dropped" );
600
602
// Test exact string match
601
603
SentryEvent *event2 = [[SentryEvent alloc ] init ];
602
- SentryMessage *msg = [[ SentryMessage alloc ] init ];
603
- msg.formatted = @" ExactError" ;
604
+ SentryMessage *msg = [SentryMessage alloc ];
605
+ msg.message = @" ExactError" ;
604
606
event2.message = msg;
605
607
SentryEvent *result2 = options.beforeSend (event2);
606
608
XCTAssertNil (result2, @" Event with exactly matching string should be dropped" );
607
609
// Test non-matching
608
610
SentryEvent *event3 = [[SentryEvent alloc ] init ];
609
- SentryMessage *msg3 = [[ SentryMessage alloc ] init ];
610
- msg3.formatted = @" OtherError" ;
611
+ SentryMessage *msg3 = [SentryMessage alloc ];
612
+ msg3.message = @" OtherError" ;
611
613
event3.message = msg3;
612
614
SentryEvent *result3 = options.beforeSend (event3);
613
615
XCTAssertNotNil (result3, @" Event with non-matching error should not be dropped" );
0 commit comments