Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove notify method variants from public API on Bugsnag #497

Merged
merged 2 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Bugsnag Notifiers on other platforms.

## Enhancements

* Remove notify method variants from public api on `Bugsnag`
[#497](https://github.com/bugsnag/bugsnag-cocoa/pull/497)

* Remove `leaveBreadcrumbWithBlock` from public api on `Bugsnag`
[#491](https://github.com/bugsnag/bugsnag-cocoa/pull/491)

Expand Down
33 changes: 0 additions & 33 deletions Source/Bugsnag.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,39 +101,6 @@ static NSString *_Nonnull const BugsnagSeverityInfo = @"info";
+ (void)notifyError:(NSError *_Nonnull)error
block:(BugsnagOnErrorBlock _Nullable)block;

/** Send a custom or caught exception to Bugsnag.
*
* The exception will be sent to Bugsnag in the background allowing your
* app to continue running.
*
* @param exception The exception.
*
* @param metadata Any additional information you want to send with the
* report.
*/
+ (void)notify:(NSException *_Nonnull)exception
withData:(NSDictionary *_Nullable)metadata
__deprecated_msg("Use notify:block: instead and add the metadata to the "
"report directly.");

/** Send a custom or caught exception to Bugsnag.
*
* The exception will be sent to Bugsnag in the background allowing your
* app to continue running.
*
* @param exception The exception.
*
* @param metadata Any additional information you want to send with the
* report.
*
* @param severity The severity level (default: BugsnagSeverityWarning)
*/
+ (void)notify:(NSException *_Nonnull)exception
withData:(NSDictionary *_Nullable)metadata
atSeverity:(NSString *_Nullable)severity
__deprecated_msg("Use notify:block: instead and add the metadata and "
"severity to the report directly.");

/**
* Intended for use by other clients (React Native/Unity). Calling this method
* directly from iOS is not supported.
Expand Down
30 changes: 0 additions & 30 deletions Source/Bugsnag.m
Original file line number Diff line number Diff line change
Expand Up @@ -124,36 +124,6 @@ + (void)notifyError:(NSError *)error block:(BugsnagOnErrorBlock)block {
}
}

+ (void)notify:(NSException *)exception withData:(NSDictionary *)metadata {
if ([self bugsnagStarted]) {
[[self client]
notifyException:exception
block:^(BugsnagEvent *_Nonnull report) {
report.depth += 2;
report.metadata = [metadata
BSG_mergedInto:[self.client.configuration
.metadata toDictionary]];
}];
}
}

+ (void)notify:(NSException *)exception
withData:(NSDictionary *)metadata
atSeverity:(NSString *)severity {
if ([self bugsnagStarted]) {
[[self client]
notifyException:exception
atSeverity:BSGParseSeverity(severity)
block:^(BugsnagEvent *_Nonnull report) {
report.depth += 2;
report.metadata = [metadata
BSG_mergedInto:[self.client.configuration
.metadata toDictionary]];
report.severity = BSGParseSeverity(severity);
}];
}
}

+ (void)internalClientNotify:(NSException *_Nonnull)exception
withData:(NSDictionary *_Nullable)metadata
block:(BugsnagOnErrorBlock _Nullable)block {
Expand Down
12 changes: 0 additions & 12 deletions Source/BugsnagClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,6 @@
- (void)notifyException:(NSException *_Nonnull)exception
block:(BugsnagOnErrorBlock _Nullable)block;

/**
* Notify Bugsnag of an exception
*
* @param exception the exception
* @param severity the severity
* @param block Configuration block for adding additional report
* information
*/
- (void)notifyException:(NSException *_Nonnull)exception
atSeverity:(BSGSeverity)severity
block:(BugsnagOnErrorBlock _Nullable)block;

/**
* Notify Bugsnag of an exception. Only intended for React Native/Unity use.
*
Expand Down
11 changes: 0 additions & 11 deletions Source/BugsnagClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -582,17 +582,6 @@ - (void)notifyError:(NSError *)error
}];
}

- (void)notifyException:(NSException *)exception
atSeverity:(BSGSeverity)severity
block:(void (^)(BugsnagEvent *))block {

BugsnagHandledState *state = [BugsnagHandledState
handledStateWithSeverityReason:UserSpecifiedSeverity
severity:severity
attrValue:nil];
[self notify:exception handledState:state block:block];
}

- (void)notifyException:(NSException *)exception
block:(void (^)(BugsnagEvent *))block {
BugsnagHandledState *state =
Expand Down
12 changes: 12 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ ObjC:
- [Bugsnag stopSession]
+ [Bugsnag pauseSession]

- [Bugsnag notify:withData:]
+ [Bugsnag notify:block:]

- [Bugsnag notify:withData:severity:]
+ [Bugsnag notify:block:]

Swift:

- Bugsnag.configuration()
Expand All @@ -119,6 +125,12 @@ Swift:

- Bugsnag.stopSession()
+ Bugsnag.pauseSession()

- Bugsnag.notify(exception:metadata:)
+ Bugsnag.notify(exception:block:)

- Bugsnag.notify(exception:metadata:severity:)
+ Bugsnag.notify(exception:block:)
```

### `BugsnagMetadata` class
Expand Down