This repository was archived by the owner on Apr 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -15,27 +15,33 @@ public final class Provider: Vapor.Provider {
1515 public func boot( _ config: Config ) throws {
1616 try config. addConfigurable ( middleware: Middleware ( config: config) , name: " bugsnag " )
1717
18- guard let config : Config = config [ " bugsnag " ] else {
18+ guard let bConfig : Config = config [ " bugsnag " ] else {
1919 throw Abort (
2020 . internalServerError,
2121 reason: " Bugsnag error - bugsnag.json config is missing. "
2222 )
2323 }
2424
25- self . config = try BugsnagConfig ( config)
25+ // NOTE: there is a bug in Vapor where extracted configs don't have the
26+ // same environment as the root config
27+ bConfig. environment = config. environment
28+ self . config = try BugsnagConfig ( bConfig)
2629 }
2730
2831 public init ( config: Config ) throws {
2932 try config. addConfigurable ( middleware: Middleware ( config: config) , name: " bugsnag " )
3033
31- guard let config : Config = config [ " bugsnag " ] else {
34+ guard let bConfig : Config = config [ " bugsnag " ] else {
3235 throw Abort (
3336 . internalServerError,
3437 reason: " Bugsnag error - bugsnag.json config is missing. "
3538 )
3639 }
3740
38- self . config = try BugsnagConfig ( config)
41+ // NOTE: there is a bug in Vapor where extracted configs don't have the
42+ // same environment as the root config
43+ bConfig. environment = config. environment
44+ self . config = try BugsnagConfig ( bConfig)
3945 }
4046
4147 // is automatically called directly after boot()
Original file line number Diff line number Diff line change @@ -3,14 +3,17 @@ import Stacked
33
44public struct ReporterFactory {
55 public static func make( config: Config ) throws -> Reporter {
6- guard let config : Config = config [ " bugsnag " ] else {
6+ guard let bConfig : Config = config [ " bugsnag " ] else {
77 throw Abort (
88 . internalServerError,
99 reason: " Bugsnag error - bugsnag.json config is missing. "
1010 )
1111 }
1212
13- let bugsnagConfig = try BugsnagConfig ( config)
13+ // NOTE: there is a bug in Vapor where extracted configs don't have the
14+ // same environment as the root config
15+ bConfig. environment = config. environment
16+ let bugsnagConfig = try BugsnagConfig ( bConfig)
1417 return ReporterFactory . make ( bugsnagConfig: bugsnagConfig)
1518 }
1619
You can’t perform that action at this time.
0 commit comments