Commit ba57bed
committed
local_timezone: gracefully handle retrieval errors on Darwin
In some sandbox environments, the program may not have
permission to access /etc/localtime or it may not exist.
Catch any exceptions accessing and parsing its value and return UTC by
default to avoid crashing the program.1 parent 3e3fec6 commit ba57bed
1 file changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
151 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
152 | 160 | | |
153 | 161 | | |
154 | 162 | | |
| |||
0 commit comments