Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add logging / error handling to GovukTimezone
The more I think about it, the more I worry that having the gem forcibly set time_zone to London without any warnings could lead to a confusing / hard to debug problem down the line. For example, someone trying to set config.time_zone explicitly to UTC, or trying to set it to something else entirely, and then being confused when it's still London. There's no way I can think of to distinguish the "time_zone is UTC because that's the default" situation from the "time_zone is UTC because it's been set explicitly" situation. Logging an info message at least increases the chance that someone will notice what's going on if they are trying to set it to UTC. We're also logging the situation where time_zone is set to London - this config is fairly widespread, and it will become redundant following this change to the gem. However it's harmless, so I don't think it's worth chasing up all the other edge cases. All other values of time_zone should be considered errors, as it would be very confusing to have them silently overridden.
- Loading branch information