Welcome to WebmasterWorld Guest from 54.159.246.164

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Detecting Time Out and Server Unavailable Messages

   
1:59 am on Oct 31, 2009 (gmt 0)

10+ Year Member



Hello All -

I'm implementing my first xml feed for a project - while this paid-for feed is unlikely to go down I need to know how to deal with this eventuality in case it does happen.

First thing I need to do - of course - is to somehow detect that the feed is unavailable. The author of the feed reports to me that if it does go down I would get a Time Out or Server Unavailable message.

I've never done error trapping for someone else's content so I'm wondering exactly how to capture these two possible messages. Would it be likely (I haven't asked the provider but probably should) that rather than an XML document I would simply get a "Time Out" or "Server Unavailable" text string?

Interested in knowing how the pros do this and greatly appreciate any information and guidance.

Neophyte

10:13 pm on Nov 9, 2009 (gmt 0)

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 5+ Year Member



You can check the response headers if that would help. If you get anything other than a 200/OK code, you could take other actions.

Look into cURL [php] for this. You should be able to grab the headers without the content body, and then you'd just check against that. At least that's what I would do. Unless the feed you are grabbing data from has something specific that could happen where you would get an OK status but there'd be no content there.

10:33 am on Nov 10, 2009 (gmt 0)

5+ Year Member



Sorry eelixduppy, this is the correct link: [php.net...] ;-)