Closed (fixed)
Project:
Flickr
Version:
6.x-1.x-dev
Component:
flickr (main module)
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Apr 2007 at 19:59 UTC
Updated:
3 May 2007 at 19:47 UTC
Jump to comment: Most recent file
Comments
Comment #1
drewish commentedyeah, good feature request. it's totally possible to do, the only downside is that the first time it'll require an api request (the result of which is cacheable). i'll look at rolling a patch.
Comment #2
drewish commentedhere's a quick one.
note for andrewlevine: take a look at what i did in flickr_people_get_info(). i'd like to start using that style of error checking/parameter extraction. it seems silly to have so many functions wrapping api calls if they don't do any of the error checking or pull out the relevant data item from the array, it's just as much code to call flickr_request in your own function. so my vote is to either have functions call flickr_request if they want detailed error handling and use the functions to simply it for most cases.
Comment #3
andrewlevine commentedI agree that wrapper methods should return the data in the easiest-to-use possible form without discarding any data.
This would be my preferred error handling strategy:
* flickr_request calls flickr_set_error if request fails
* flickr_set_error prints error if user is admin and logs error no matter what
* flickr_wrapper returns NULL on error
* caller of flickr_wrapper prints whatever error messages necessary
Comment #4
drewish commentedhere's a re-roll in the new style.
Comment #5
drewish commentedi committed this.
Comment #6
telex4 commentedGreat! Thanks for the quick work :)
Comment #7
(not verified) commented