Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Prioritize the request’s private container
Browse files Browse the repository at this point in the history
  • Loading branch information
steffendsommer committed Feb 14, 2019
1 parent 4611c7c commit dcd2ecf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Bugsnag/BugsnagReporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ public struct BugsnagReporter: Service {
extension BugsnagReporter: ErrorReporter {
private func buildBody(
_ container: Container,
req: Request?,
error: Error,
severity: Severity,
userId: CustomStringConvertible?,
metadata: [String: CustomDebugStringConvertible],
stacktrace: BugsnagStacktrace
) throws -> Data {
let breadcrumbs: [BugsnagBreadcrumb] = (try? container
let req = container as? Request
let breadcrumbsContainer = req?.privateContainer ?? container
let breadcrumbs: [BugsnagBreadcrumb] = (try? breadcrumbsContainer
.make(BreadcrumbContainer.self))?
.breadcrumbs ?? []

Expand Down Expand Up @@ -95,7 +96,6 @@ extension BugsnagReporter: ErrorReporter {
return Future.flatMap(on: container) {
let body = try self.buildBody(
container,
req: container as? Request,
error: error,
severity: severity,
userId: userId,
Expand Down

0 comments on commit dcd2ecf

Please sign in to comment.