-
Notifications
You must be signed in to change notification settings - Fork 41
Improve no timezone db error #289
Improve no timezone db error #289
Conversation
Codecov Report
@@ Coverage Diff @@
## main #289 +/- ##
=======================================
+ Coverage 76.8% 77.0% +0.1%
=======================================
Files 94 94
Lines 4410 4410
=======================================
+ Hits 3391 3397 +6
+ Misses 700 697 -3
+ Partials 319 316 -3
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -75,7 +75,7 @@ func (c SyslogParserConfig) Build(context operator.BuildContext) ([]operator.Ope | |||
|
|||
location, err := time.LoadLocation(c.Location) | |||
if err != nil { | |||
return nil, err | |||
return nil, fmt.Errorf("failed to load location %s (is the timezone database installed?): %w", c.Location, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can appreciate what you're getting at here, but an error message that asks a question is unusual. More importantly, I suspect this will be a red herring in the majority of cases, since the most common cause of this error will be users specifying an invalid location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For context, on Windows, the timezone database is generally not present. While on Linux it is common to have the tzdata package installed by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was kinda iffy on about putting that in there, too. I'll take the question out. Knowing that it failed to load the location should probably be enough to debug.
- `combine_with` setting to `recombine` operator, to allow for joining on custom delimiter ([PR315](open-telemetry#315)) - Issue where `force_flush_period` could cause line splitting to be skipped ([PR303](open-telemetry#303)) - Issue where `tcp_input` and `udp_input` could panic when stopping ([PR273](open-telemetry#273)) - Syslog severity mapping is now aligned with log specification ([PR300](open-telemetry#300)) - Improve error message when timezone database is not found ([PR289](open-telemetry#289))
- `combine_with` setting to `recombine` operator, to allow for joining on custom delimiter ([PR315](#315)) - Issue where `force_flush_period` could cause line splitting to be skipped ([PR303](#303)) - Issue where `tcp_input` and `udp_input` could panic when stopping ([PR273](#273)) - Syslog severity mapping is now aligned with log specification ([PR300](#300)) - Improve error message when timezone database is not found ([PR289](#289))
Closes #288
This PR wraps the error returned from time.LoadLocation to include that a location was trying to be loaded, and that the timezone database may not be present.