Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-21-2010, 01:33 PM   PM User | #1
martin_narg
Regular Coder

 
martin_narg's Avatar
 
Join Date: Jul 2002
Location: Chamonix, France
Posts: 600
Thanks: 1
Thanked 3 Times in 3 Posts
martin_narg is an unknown quantity at this point
Creating clean RSS errors

Hey all

Currently writing a PHP app, part of which generates RSS feeds.

I'm wondering whats the best way to output error messages to a dynamically created RSS page.

For example if a user isn't logged in to my app and tries to access a feed url, I'd like to output a handle-able 'You don't have permission to access this' message.

I'm wondering if anyone knows how RSS readers generally handle errors (HTTP error codes would definitely be one) but is there a generic, widely used way of putting error messages into the XML document itself to be cleanly handled? Is the best way just to create an item node with the error details within it?

Cheers for your responses.

m_n
__________________
"Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
-Tommy Cooper

Last edited by martin_narg; 10-21-2010 at 04:36 PM..
martin_narg is offline   Reply With Quote
Old 10-21-2010, 07:14 PM   PM User | #2
MattF
Senior Coder

 
Join Date: Jul 2009
Location: South Yorkshire, England
Posts: 2,322
Thanks: 6
Thanked 304 Times in 303 Posts
MattF will become famous soon enoughMattF will become famous soon enough
Just send a 204, (no content), or 404 response. Whichever you prefer. No point in shunting output to the client just to tell them they can't view the feed, and if you use the 204, it won't alter their cached version of the feed if the current reason is simply because they're not logged in or suchlike.
MattF is offline   Reply With Quote
Users who have thanked MattF for this post:
martin_narg (10-22-2010)
Old 10-22-2010, 11:23 AM   PM User | #3
martin_narg
Regular Coder

 
martin_narg's Avatar
 
Join Date: Jul 2002
Location: Chamonix, France
Posts: 600
Thanks: 1
Thanked 3 Times in 3 Posts
martin_narg is an unknown quantity at this point
That's cool thanks, I think I'll just do that.

Cheers for the shout on the caching, not something I'd thought of.

m_n
__________________
"Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
-Tommy Cooper
martin_narg is offline   Reply With Quote
Reply

Bookmarks

Tags
error messages, handled error messages, php, rss, xml

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:18 AM.


Advertisement
Log in to turn off these ads.