@@ -165,7 +165,7 @@ func (c *Config) LoadDefaults(ctx context.Context) {
165
165
if err != nil {
166
166
span .RecordError (err )
167
167
span .End ()
168
- log .Panic (fmt .Errorf ("failed to unmarshal global configuration: %w" , err ))
168
+ log .Fatal (fmt .Errorf ("failed to unmarshal global configuration: %w" , err ))
169
169
}
170
170
171
171
for configObject , configMap := range gconf {
@@ -194,15 +194,15 @@ func (c *Config) LoadDefaults(ctx context.Context) {
194
194
err := fmt .Errorf ("unknown config object: %s" , configObject )
195
195
span .RecordError (err )
196
196
span .End ()
197
- log .Panic (err )
197
+ log .Fatal (err )
198
198
}
199
199
}
200
200
}
201
201
}
202
202
} else if ! os .IsNotExist (err ) {
203
203
span .RecordError (err )
204
204
span .End ()
205
- log .Panic (fmt .Errorf ("failed to read global configuration file: %w" , err ))
205
+ log .Fatal (fmt .Errorf ("failed to read global configuration file: %w" , err ))
206
206
}
207
207
208
208
c .pluginDefaults = PluginConfig {
@@ -222,15 +222,15 @@ func (c *Config) LoadDefaults(ctx context.Context) {
222
222
if err := c .GlobalKoanf .Load (structs .Provider (c .globalDefaults , "json" ), nil ); err != nil {
223
223
span .RecordError (err )
224
224
span .End ()
225
- log .Panic (fmt .Errorf ("failed to load default global configuration: %w" , err ))
225
+ log .Fatal (fmt .Errorf ("failed to load default global configuration: %w" , err ))
226
226
}
227
227
}
228
228
229
229
if c .PluginKoanf != nil {
230
230
if err := c .PluginKoanf .Load (structs .Provider (c .pluginDefaults , "json" ), nil ); err != nil {
231
231
span .RecordError (err )
232
232
span .End ()
233
- log .Panic (fmt .Errorf ("failed to load default plugin configuration: %w" , err ))
233
+ log .Fatal (fmt .Errorf ("failed to load default plugin configuration: %w" , err ))
234
234
}
235
235
}
236
236
@@ -245,7 +245,7 @@ func (c *Config) LoadGlobalEnvVars(ctx context.Context) {
245
245
if err := c .GlobalKoanf .Load (loadEnvVars (), nil ); err != nil {
246
246
span .RecordError (err )
247
247
span .End ()
248
- log .Panic (fmt .Errorf ("failed to load environment variables: %w" , err ))
248
+ log .Fatal (fmt .Errorf ("failed to load environment variables: %w" , err ))
249
249
}
250
250
251
251
span .End ()
@@ -259,7 +259,7 @@ func (c *Config) LoadPluginEnvVars(ctx context.Context) {
259
259
if err := c .PluginKoanf .Load (loadEnvVars (), nil ); err != nil {
260
260
span .RecordError (err )
261
261
span .End ()
262
- log .Panic (fmt .Errorf ("failed to load environment variables: %w" , err ))
262
+ log .Fatal (fmt .Errorf ("failed to load environment variables: %w" , err ))
263
263
}
264
264
265
265
span .End ()
@@ -278,7 +278,7 @@ func (c *Config) LoadGlobalConfigFile(ctx context.Context) {
278
278
if err := c .GlobalKoanf .Load (file .Provider (c .globalConfigFile ), yaml .Parser ()); err != nil {
279
279
span .RecordError (err )
280
280
span .End ()
281
- log .Panic (fmt .Errorf ("failed to load global configuration: %w" , err ))
281
+ log .Fatal (fmt .Errorf ("failed to load global configuration: %w" , err ))
282
282
}
283
283
284
284
span .End ()
@@ -291,7 +291,7 @@ func (c *Config) LoadPluginConfigFile(ctx context.Context) {
291
291
if err := c .PluginKoanf .Load (file .Provider (c .pluginConfigFile ), yaml .Parser ()); err != nil {
292
292
span .RecordError (err )
293
293
span .End ()
294
- log .Panic (fmt .Errorf ("failed to load plugin configuration: %w" , err ))
294
+ log .Fatal (fmt .Errorf ("failed to load plugin configuration: %w" , err ))
295
295
}
296
296
297
297
span .End ()
@@ -306,7 +306,7 @@ func (c *Config) UnmarshalGlobalConfig(ctx context.Context) {
306
306
}); err != nil {
307
307
span .RecordError (err )
308
308
span .End ()
309
- log .Panic (fmt .Errorf ("failed to unmarshal global configuration: %w" , err ))
309
+ log .Fatal (fmt .Errorf ("failed to unmarshal global configuration: %w" , err ))
310
310
}
311
311
312
312
span .End ()
@@ -321,7 +321,7 @@ func (c *Config) UnmarshalPluginConfig(ctx context.Context) {
321
321
}); err != nil {
322
322
span .RecordError (err )
323
323
span .End ()
324
- log .Panic (fmt .Errorf ("failed to unmarshal plugin configuration: %w" , err ))
324
+ log .Fatal (fmt .Errorf ("failed to unmarshal plugin configuration: %w" , err ))
325
325
}
326
326
327
327
span .End ()
@@ -335,15 +335,15 @@ func (c *Config) MergeGlobalConfig(
335
335
if err := c .GlobalKoanf .Load (confmap .Provider (updatedGlobalConfig , "." ), nil ); err != nil {
336
336
span .RecordError (err )
337
337
span .End ()
338
- log .Panic (fmt .Errorf ("failed to merge global configuration: %w" , err ))
338
+ log .Fatal (fmt .Errorf ("failed to merge global configuration: %w" , err ))
339
339
}
340
340
341
341
if err := c .GlobalKoanf .UnmarshalWithConf ("" , & c .Global , koanf.UnmarshalConf {
342
342
Tag : "json" ,
343
343
}); err != nil {
344
344
span .RecordError (err )
345
345
span .End ()
346
- log .Panic (fmt .Errorf ("failed to unmarshal global configuration: %w" , err ))
346
+ log .Fatal (fmt .Errorf ("failed to unmarshal global configuration: %w" , err ))
347
347
}
348
348
349
349
span .End ()
@@ -356,7 +356,7 @@ func (c *Config) ValidateGlobalConfig(ctx context.Context) {
356
356
if err := c .GlobalKoanf .Unmarshal ("" , & globalConfig ); err != nil {
357
357
span .RecordError (err )
358
358
span .End ()
359
- log .Panic (
359
+ log .Fatal (
360
360
gerr .ErrValidationFailed .Wrap (
361
361
fmt .Errorf ("failed to unmarshal global configuration: %w" , err )),
362
362
)
@@ -466,6 +466,6 @@ func (c *Config) ValidateGlobalConfig(ctx context.Context) {
466
466
}
467
467
span .RecordError (fmt .Errorf ("failed to validate global configuration" ))
468
468
span .End ()
469
- log .Panic ("failed to validate global configuration" )
469
+ log .Fatal ("failed to validate global configuration" )
470
470
}
471
471
}
0 commit comments