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

Commit

Permalink
Merge pull request #45 from nodes-vapor/bugfix/make-sure-env-is-set
Browse files Browse the repository at this point in the history
Update ReporterFactory.swift
  • Loading branch information
steffendsommer authored Mar 27, 2018
2 parents 357e11d + ee33b95 commit 210f52e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Sources/Bugsnag/ReporterFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ import Stacked

public struct ReporterFactory {
public static func make(config: Config) throws -> Reporter {
guard let config: Config = config["bugsnag"] else {
guard let bConfig: Config = config["bugsnag"] else {
throw Abort(
.internalServerError,
reason: "Bugsnag error - bugsnag.json config is missing."
)
}

let bugsnagConfig = try BugsnagConfig(config)
// NOTE: there is a bug in Vapor where extracted configs don't have the
// same environment as the root config
bConfig.environment = config.environment
let bugsnagConfig = try BugsnagConfig(bConfig)

return ReporterFactory.make(bugsnagConfig: bugsnagConfig)
}

Expand Down

0 comments on commit 210f52e

Please # to comment.