Skip to content

Commit 7bd8980

Browse files
Improve tracing when reading timezone cookie (#863)
1 parent ff2432b commit 7bd8980

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

dotnet/src/dotnetframework/GxClasses/Core/GXApplication.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3616,8 +3616,22 @@ internal string ClientTimeZoneId
36163616
}
36173617
try
36183618
{
3619-
_currentTimeZoneId = !DateTimeUtil.ValidTimeZone(sTZ) ? DateTimeZoneProviders.Tzdb.GetSystemDefault().Id : sTZ;
3620-
3619+
if (!DateTimeUtil.ValidTimeZone(sTZ))
3620+
{
3621+
try
3622+
{
3623+
string invalidTimezone = DateTimeZoneProviders.Tzdb[sTZ].Id;
3624+
}catch(Exception ex)//DateTimeZoneNotFound
3625+
{
3626+
GXLogging.Warn(log, $"Client timezone not found: {sTZ}", ex);
3627+
}
3628+
_currentTimeZoneId = DateTimeZoneProviders.Tzdb.GetSystemDefault().Id;
3629+
GXLogging.Warn(log, $"Setting Client timezone to System default: {_currentTimeZoneId}");
3630+
}
3631+
else
3632+
{
3633+
_currentTimeZoneId = sTZ;
3634+
}
36213635
}
36223636
catch (Exception e1)
36233637
{

0 commit comments

Comments
 (0)