]> code.delx.au - comingnext/blobdiff - comingNext/index.html
added info for T7-00 support (tested on Nokia RDA service). First working Anna device...
[comingnext] / comingNext / index.html
index 0551a3ed4304b50afda37ff1c54d877e483fc8c3..518c31d5331c6053932d55d13c9dcd24e0a862f8 100644 (file)
@@ -104,6 +104,7 @@ var lastReloadTime = null; // last time we fetched calendar data
 var reloadInterval = 6 * 60 * 60 * 1000; // = 6 hours; time interval for reloading calendar data\r
 var errorOccured = false;\r
 var entryLists = null; // stores all fetched calendar entries until data is refreshed\r
+var statupSuccessful = false; // indicates if everything started up wihtout errors. If we detect an error after that, it might just be a temporary problem e.g. by a backup process.\r
 \r
 // vars for daylight saving time\r
 var summertime = false; // true, if current date is in summer, false if in winter\r
@@ -540,6 +541,16 @@ function updateData()
 \r
        // check if we got additional or less calendars since our last update\r
        var newCalendarList = listCalendars();\r
+       if (newCalendarList == null) {\r
+               // Something went wrong fetching the calendars list.\r
+               // This usually happens when a backup is being made.\r
+               // Retry the next time updateData() is called by \r
+               // resetting errorOccured\r
+               log('updateData(): listCalendars() failed, trying again laster...');\r
+               cacheEntriesHtml = ''; // make sure we replace the currently shown error message on the next update\r
+               errorOccured = false;\r
+               return;\r
+       }\r
        if (newCalendarList.length != calendarList.length) {\r
                calendarList = newCalendarList;\r
                updateCalendarColors();\r
@@ -914,6 +925,8 @@ function init()
        window.widget.onshow = handleOnShow;\r
 \r
        log("init(): finished...");\r
+       if (!errorOccured)\r
+               statupSuccessful = true;\r
 }\r
 \r
 function checkOrientation()\r
@@ -1086,9 +1099,14 @@ function getSettingsCalEntryId()
                                Type: 'DayEvent'\r
                        }\r
                }\r
-               var result = calendarService.IDataSource.GetList(listFiltering);\r
-               if (result.ErrorCode) {\r
-                       error('getSettingsCalEntryId: GetList() failed: ' + result.ErrorMessage);\r
+               var result = null;\r
+               try {\r
+                       result = calendarService.IDataSource.GetList(listFiltering);\r
+                       if (result.ErrorCode)\r
+                               throw(result.ErrorMessage);\r
+               }\r
+               catch (e) {\r
+                       error("getSettingsCalEntryId: GetList() failed: " + e + ', line ' + e.line);\r
                        return;\r
                }\r
                var list = result.ReturnValue;\r
@@ -1135,9 +1153,14 @@ function loadSettings()
                        LocalId: settingsCalEntryId\r
                }\r
        }\r
-       var result = calendarService.IDataSource.GetList(listFiltering);\r
-       if (result.ErrorCode) {\r
-               error('loadSettings: GetList() failed: ' + result.ErrorMessage);\r
+       var result = null;\r
+       try     {\r
+               result = calendarService.IDataSource.GetList(listFiltering);\r
+               if (result.ErrorCode)\r
+                       throw(result.ErrorMessage);\r
+       }\r
+       catch (e) {\r
+               error("loadSettings: GetList() failed: " + e + ', line ' + e.line);\r
                return;\r
        }\r
        var entry = result.ReturnValue.getNext();\r