From 11e5016af0fae8b89a7eb28519ab53499f232a46 Mon Sep 17 00:00:00 2001 From: Dhiogo Brustolin Date: Thu, 21 Apr 2022 10:20:46 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Philipp Hofmann --- CHANGELOG.md | 2 +- Sources/Sentry/Public/SentryOptions.h | 2 +- Sources/Sentry/SentryClient.m | 4 ++-- Tests/SentryTests/SentryClientTests.swift | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab94ef0d248..e8be04252d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- feat: Error Screenshots (#1751) +- feat: Attach screenshots for errors (#1751) - fix: Remove authenticated pointer stripping for iOS backtraces (#1757) ## 7.13.0 diff --git a/Sources/Sentry/Public/SentryOptions.h b/Sources/Sentry/Public/SentryOptions.h index ef8269b79fd..59cd27af4b5 100644 --- a/Sources/Sentry/Public/SentryOptions.h +++ b/Sources/Sentry/Public/SentryOptions.h @@ -193,7 +193,7 @@ NS_SWIFT_NAME(Options) @property (nonatomic, assign) BOOL enableUIViewControllerTracking; /** - * Automatically attaches a screenshot when an error or exception is captured. + * Automatically attaches a screenshot when capturing an error or exception. * * Default value is NO */ diff --git a/Sources/Sentry/SentryClient.m b/Sources/Sentry/SentryClient.m index fae258957cf..a3a853dfac2 100644 --- a/Sources/Sentry/SentryClient.m +++ b/Sources/Sentry/SentryClient.m @@ -158,7 +158,7 @@ - (SentryId *)captureException:(NSException *)exception return [self sendEvent:event withSession:session withScope:scope]; } -- (SentryEvent *)buildExceptionEvent:(NSException *)exception scope:(SentryScope *)scope +- (SentryEvent *)buildExceptionEvent:(NSException *)exception { SentryEvent *event = [[SentryEvent alloc] initWithLevel:kSentryLevelError]; SentryException *sentryException = [[SentryException alloc] initWithValue:exception.reason @@ -189,7 +189,7 @@ - (SentryId *)captureError:(NSError *)error return [self sendEvent:event withSession:session withScope:scope]; } -- (SentryEvent *)buildErrorEvent:(NSError *)error scope:(SentryScope *)scope +- (SentryEvent *)buildErrorEvent:(NSError *)error { SentryEvent *event = [[SentryEvent alloc] initWithError:error]; diff --git a/Tests/SentryTests/SentryClientTests.swift b/Tests/SentryTests/SentryClientTests.swift index 8ad040d5175..2571b7c6837 100644 --- a/Tests/SentryTests/SentryClientTests.swift +++ b/Tests/SentryTests/SentryClientTests.swift @@ -252,7 +252,7 @@ class SentryClientTest: XCTestCase { sut.attachmentProcessor = processor sut.captureError(error, with: fixture.session, with: Scope()) - let sendedAttachments = fixture.transportAdapter.sentEventsWithSessionTraceState.first?.attachments ?? [] + let sentAttachments = fixture.transportAdapter.sentEventsWithSessionTraceState.first?.attachments ?? [] XCTAssertEqual(sendedAttachments.count, 1) XCTAssertEqual(extraAttachment, sendedAttachments.first)