Skip to content

Commit

Permalink
ref: Make description in SpanProtocol nonnull
Browse files Browse the repository at this point in the history
SentrySpanProtocol.startChildWithOperation has an overload without a
description if you don't want to specify a description. We don't need
the description to be nullable.
  • Loading branch information
philipphofmann committed Apr 20, 2021
1 parent 64cd981 commit b370a21
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## unreleased

- ref: Make description in SpanProtocol nonnull #1059

## 7.0.0-beta.0

- feat: Add close method to SDK #1046
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/Public/SentrySpanProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ NS_SWIFT_NAME(Span)
* @return SentrySpan
*/
- (id<SentrySpan>)startChildWithOperation:(NSString *)operation
description:(nullable NSString *)description
description:(NSString *)description
NS_SWIFT_NAME(startChild(operation:description:));

/**
Expand Down
11 changes: 8 additions & 3 deletions Sources/Sentry/SentrySpan.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@ - (instancetype)initWithContext:(SentrySpanContext *)context

- (id<SentrySpan>)startChildWithOperation:(NSString *)operation
{
return [self startChildWithOperation:operation description:nil];
return [self startChildWithOperationInternal:operation description:nil];
}

- (id<SentrySpan>)startChildWithOperation:(NSString *)operation
description:(nullable NSString *)description
- (id<SentrySpan>)startChildWithOperation:(NSString *)operation description:(NSString *)description
{
return [self startChildWithOperationInternal:operation description:description];
}

- (id<SentrySpan>)startChildWithOperationInternal:(NSString *)operation
description:(nullable NSString *)description
{
return [self.tracer startChildWithParentId:[self.context spanId]
operation:operation
Expand Down
12 changes: 0 additions & 12 deletions Sources/Sentry/include/SentrySpan.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,6 @@ SENTRY_NO_INIT
- (id<SentrySpan>)startChildWithOperation:(NSString *)operation
NS_SWIFT_NAME(startChild(operation:));

/**
* Starts a child span.
*
* @param operation Defines the child span operation.
* @param description Define the child span description.
*
* @return SentrySpan
*/
- (id<SentrySpan>)startChildWithOperation:(NSString *)operation
description:(nullable NSString *)description
NS_SWIFT_NAME(startChild(operation:description:));

/**
* Sets an extra.
*/
Expand Down

0 comments on commit b370a21

Please sign in to comment.