danriegsecker / as3syndicationlib

Automatically exported from code.google.com/p/as3syndicationlib
0 stars 0 forks source link

Invalid RFC 822 dates throw Error from IItem.date #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Retrieve a feed that has an invalid RFC 822 date (e.g. "3/1/07 12:00:00
AM EST")
2. Attempt to retrieve IItem.date
3. An error is thrown:

Error: Unable to parse the string [3/1/07 12:00:00 AM EST] into a date. The
internal error was: TypeError: Error #1009: Cannot access a property or
method of a null object reference.
    at com.adobe.utils::DateUtil$/parseRFC822()[C:\Documents and
Settings\mchamber\My
Documents\src\flashplatform\projects\corelib\trunk\src\actionscript3\com\adobe\u
tils\DateUtil.as:460]
    at com.adobe.xml.syndication::ParsingTools$/dateCheck()[C:\Documents and
Settings\mchamber\My
Documents\src\flashplatform\projects\xmlsyndication\trunk\src\actionscript3\com\
adobe\xml\syndication\ParsingTools.as:116]
    at com.adobe.xml.syndication.rss::Item20/get pubDate()[C:\Documents and
Settings\mchamber\My
Documents\src\flashplatform\projects\xmlsyndication\trunk\src\actionscript3\com\
adobe\xml\syndication\rss\Item20.as:161]
    at com.adobe.xml.syndication.generic::RSS20Item/get date()[C:\Documents
and Settings\mchamber\My
Documents\src\flashplatform\projects\xmlsyndication\trunk\src\actionscript3\com\
adobe\xml\syndication\generic\RSS20Item.as:118]
    at
RSSTagger/RSSTagger::generateDisplayRssHtml()[D:\Devel\Risk\Engineering\src\rss_
tagger\src\RSSTagger.mxml:154]
    at ()[D:\Devel\Risk\Engineering\src\rss_tagger\src\RSSTagger.mxml:84]
    at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio
n()
    at flash.events::EventDispatcher/dispatchEvent()[C:\Documents and
Settings\acrorel\Local Settings\Temp\aslibc-26332\EventDispatcher.as:184]
    at
mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcE
vent()[C:\dev\enterprise_bali\frameworks\mx\rpc\AbstractInvoker.as:146]
    at
mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandle
r()[C:\dev\enterprise_bali\frameworks\mx\rpc\AbstractInvoker.as:168]
    at
mx.rpc::Responder/result()[C:\dev\enterprise_bali\frameworks\mx\rpc\Responder.as
:48]
    at
mx.rpc::AsyncRequest/acknowledge()[C:\dev\enterprise_bali\frameworks\mx\rpc\Asyn
cRequest.as:82]
    at
DirectHTTPChannel.as$139::DirectHTTPMessageResponder/completeHandler()[C:\dev\en
terprise_bali\frameworks\mx\messaging\channels\DirectHTTPChannel.as:359]
    at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio
n()
    at flash.events::EventDispatcher/dispatchEvent()[C:\Documents and
Settings\acrorel\Local Settings\Temp\aslibc-26332\EventDispatcher.as:180]
    at flash.net::URLLoader/flash.net:URLLoader::onComplete()[C:\Documents and
Settings\acrorel\Local Settings\Temp\aslibc-26332\URLLoader.as:415]

What is the expected output? What do you see instead?

The expected output is the date.  What is seen is the stack trace above.

What version of the product are you using? On what operating system?

0.85 on WinXP

Please provide any additional information below.

Perhaps some try..catch can be done in Item20.pubDate() to be tolerant of
invalid dates.  I would prefer to get no date rather than an exception.

Original issue reported on code.google.com by rgrzywin...@gmail.com on 10 May 2007 at 6:51

GoogleCodeExporter commented 9 years ago
Confirmed. Is there any plans on fixing this bug?

Original comment by hrun...@gmail.com on 1 Feb 2008 at 11:29

GoogleCodeExporter commented 9 years ago
For rss.Item20, you can use 

Date.parse( item.xml.pubDate );

to get the timestamp.
Maybe using the native AS parsing method would be better than the flex one ?

Original comment by acre...@gmail.com on 5 May 2008 at 4:14

GoogleCodeExporter commented 9 years ago
I think that my original point (having been so long since I filed) was that an 
invalid date was causing the whole thing to choke rather than simply 
try-catch'ing 
the bad date and ignoring it. 

Original comment by rgrzywin...@gmail.com on 13 May 2008 at 1:05