Ticket #1832 (closed defect: fixed)
If no Flickr API key set, have useful error
| Reported by: | smagnusson | Owned by: | lperera |
|---|---|---|---|
| Priority: | medium | Milestone: | |
| Component: | Modules - Mashups (Flickr, Youtube, Technorati) | Version: | |
| Severity: | medium effort / impact | Keywords: | |
| Cc: | Hours: |
Description (last modified by smagnusson) (diff)
Change the current error if no API key is set to:
You need to set the Flickr API key so that your SilverStripe? website is permitted to commnicate with Flickr.
Get one at http://www.flickr.com/services/api/keys/apply/ and add the code to mysite/_config.php, e.g:
FlickrService::setAPIKey('yyoouurrkkeeyyhheerree');
The current message below is disconcerting and not useful :P
Fatal error: Uncaught exception 'Exception' with message 'Flickr Service Error : Invalid API Key (Key not found)' in /sites/dev.silverstripe.com/smagnusson/SilverStripeTestSite/flickrservice/code/FlickrService.php:22 Stack trace: #0 /sites/dev.silverstripe.com/smagnusson/SilverStripeTestSite/sapphire/api/RestfulService.php(51): FlickrService?->errorCatch('<?xml version="...') #1 /sites/dev.silverstripe.com/smagnusson/SilverStripeTestSite/flickrservice/code/FlickrService.php(47): RestfulService?->connect() #2 /sites/dev.silverstripe.com/smagnusson/SilverStripeTestSite/flickrservice/code/FlickrGallery.php(51): FlickrService?->getPhotos('cats', NULL, '20', 1, 'interestingness...') #3 [internal function]: FlickrGallery?->FlickrPhotos?() #4 /sites/dev.silverstripe.com/smagnusson/SilverStripeTestSite/sapphire/core/Object.php(168): call_user_func_array(Array, Array) #5 [internal function]: Object->call('FlickrPhotos?', Array) #6 /sites/dev.silverstripe.com/smagnusson/SilverStripeTestSite/flickrservice/code/FlickrGallery.php(103): Fl in /sites/dev.silverstripe.com/smagnusson/SilverStripeTestSite/flickrservice/code/FlickrService.php on line 22
