View Issue Details

IDProjectCategoryView StatusLast Update
0000244NNW API ServiceUncategorizedpublicJanuary 13, 2017, 11:36 am
ReporterScott Bradford Assigned ToScott Bradford  
PriorityurgentSeveritymajor 
Status closedResolutionfixed 
Product Version0.7 
Summary0000244: Need Graceful Handling of XML Parse Errors for Warnings
Description

Need Graceful Handling of XML Parse Errors for Warnings

Activities

Scott Bradford

August 19, 2014, 4:27 pm

administrator   ~0000523

We are throwing PHP fatal errors when we have trouble parsing the warnings ATOM feed from the National Weather Service.

We need to check XML validity and, in the event of bad data, discard and try again on the next regular update cycle. In the mean time, we can continue spitting out warnings from the cache.

Example errors:

19-Aug-2014 10:18:12 America/New_York] PHP Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in getweather.php:263
Stack trace:
#0 getweather.php(263): SimpleXMLElement->__construct('')
#1 getweather.php(852): updateWarnCache(1408457889, 'US')
#2 {main}
thrown in getweather.php on line 263

[19-Aug-2014 14:03:32 America/New_York] PHP Warning: SimpleXMLElement::construct(): Entity: line 1: parser error : Start tag expected, '<' not found in getweather.php on line 263
[19-Aug-2014 14:03:32 America/New_York] PHP Warning: SimpleXMLElement::construct(): ? cannot read /www1/cap_atom/web/cap/us.atom in getweather.php on line 263
[19-Aug-2014 14:03:32 America/New_York] PHP Warning: SimpleXMLElement::
construct(): ^ in getweather.php on line 263
[19-Aug-2014 14:03:32 America/New_York] PHP Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in getweather.php:263
Stack trace:
#0 getweather.php(263): SimpleXMLElement->
construct('? cannot read /...')
#1 getweather.php(852): updateWarnCache(1408471410, 'US')
#2 {main}
thrown in getweather.php on line 263

Scott Bradford

August 19, 2014, 7:05 pm

administrator   ~0000525

Implemented proper error handling for any XML errors that occur, either in the warnings or in the NWS forecast/conditions data.

Scott Bradford

August 18, 2015, 1:23 pm

administrator   ~0001059

Closing (all resolved and published)

Issue History

Date Modified Username Field Change
December 31, 1969, 7:33 pm Scott Bradford Priority @0@ => @0@
December 31, 1969, 7:33 pm Scott Bradford Severity @0@ => @0@
December 31, 1969, 7:33 pm Scott Bradford Status @0@ => @0@
December 31, 1969, 7:33 pm Scott Bradford Resolution @0@ => @0@
August 19, 2014, 4:27 pm Scott Bradford New Issue
August 18, 2015, 10:43 am Scott Bradford Project @44@ => No-Nonsense Weather
August 18, 2015, 11:19 am Scott Bradford Category General => Uncategorized
August 18, 2015, 1:23 pm Scott Bradford Note Added: 0001059
August 18, 2015, 1:23 pm Scott Bradford Status resolved => closed
September 24, 2016, 5:14 pm Scott Bradford Project No-Nonsense Weather => NNW API Service
January 13, 2017, 11:36 am Changeset attached => NNW Web trunk r692