Addind timezone exceptions

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-01-13 10:00:41 -08:00
parent f2ca26bd4f
commit 024317d06f
+8 -2
View File
@@ -1,5 +1,6 @@
using System; using System;
using System.Web; using System.Web;
using Orchard.Logging;
namespace Orchard.Time { namespace Orchard.Time {
/// <summary> /// <summary>
@@ -10,8 +11,12 @@ namespace Orchard.Time {
public SiteTimeZoneSelector(IWorkContextAccessor workContextAccessor) { public SiteTimeZoneSelector(IWorkContextAccessor workContextAccessor) {
_workContextAccessor = workContextAccessor; _workContextAccessor = workContextAccessor;
Logger = NullLogger.Instance;
} }
public ILogger Logger { get; set; }
public TimeZoneSelectorResult GetTimeZone(HttpContextBase context) { public TimeZoneSelectorResult GetTimeZone(HttpContextBase context) {
try { try {
@@ -25,9 +30,10 @@ namespace Orchard.Time {
Priority = -5, Priority = -5,
TimeZone = TimeZoneInfo.FindSystemTimeZoneById(siteTimeZoneId) TimeZone = TimeZoneInfo.FindSystemTimeZoneById(siteTimeZoneId)
}; };
} }
catch { catch(Exception e) {
Logger.Error(e, "TimeZone could not be loaded");
// if the database could not be updated in time, ignore this provider // if the database could not be updated in time, ignore this provider
return null; return null;
} }