Welcome to WebmasterWorld Guest from

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)

Preferred Member

10+ Year Member

joined:Aug 20, 2004
posts: 615
votes: 0

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.


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

Senior Member

joined:Nov 12, 2005
votes: 0

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)

Junior Member

10+ Year Member

joined:May 25, 2006
posts: 182
votes: 0

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