You are viewing a plain text version of this content. The canonical link for it is here.
Posted to photark-dev@incubator.apache.org by Luciano Resende <lu...@gmail.com> on 2009/04/10 21:37:23 UTC
Handling invalid album feeds
On Fri, Apr 10, 2009 at 3:40 AM, Angela Cymbalak <a....@nechtan.org> wrote:
>
>> >> Can you remind me again about the issue that you are having ?
>> >
>> > If you do not have an Internet connection then the feeds throws an
>> > exception.
>> >
>>
>> Ok, I can't promise anything for this week, but I can try taking a look at
>> this.
>
> Do you know where there is good documentation on the error handling for
> annotations? I can handle the exception but I haven't been able to find
> good documentation on how error handling with annotations works.
>
I can't understand the annotation thing here, but for the case you mentioned.
Here is what I think it' s happening :
- We try to process the album references in AlbumImpl
- SCA runtime can't find the feed service, and throw an exception
I quickly reproduced this by modifying one of the feed uri in the
photo-gallery.composite and it seems that we can treat this issue by
surrounding the code that process each album with a try/catch like :
if (albumFeed != null) {
try {
for(org.apache.abdera.model.Entry feedPicture :
albumFeed.getFeed().getEntries()) {
String feedImageLink =
feedPicture.getEnclosureLinkResolvedHref().toString();
pictures.add(feedImageLink);
}
}catch (Exception e) {
//log exception, warn user that album xxx was not processed (not found)
}
}
Please let me know if this is the same issue you were seeing, and if
this solve your problem... I';; commit these changes in a few minutes
--
Luciano Resende
Apache Tuscany, Apache PhotArk
http://people.apache.org/~lresende
http://lresende.blogspot.com/
Re: Handling invalid album feeds
Posted by Angela Cymbalak <a....@nechtan.org>.
I'll check this out. I was thinking annotations needed a different
type of try/catch statement that I was unaware of because when I
tried what you have below, I keep getting compile time issues.
Angie
At 05:37 PM 4/10/2009, you wrote:
>On Fri, Apr 10, 2009 at 3:40 AM, Angela Cymbalak
><a....@nechtan.org> wrote:
> >
> >> >> Can you remind me again about the issue that you are having ?
> >> >
> >> > If you do not have an Internet connection then the feeds throws an
> >> > exception.
> >> >
> >>
> >> Ok, I can't promise anything for this week, but I can try taking a look at
> >> this.
> >
> > Do you know where there is good documentation on the error handling for
> > annotations? I can handle the exception but I haven't been able to find
> > good documentation on how error handling with annotations works.
> >
>
>I can't understand the annotation thing here, but for the case you mentioned.
>Here is what I think it' s happening :
>
>- We try to process the album references in AlbumImpl
>- SCA runtime can't find the feed service, and throw an exception
>
>I quickly reproduced this by modifying one of the feed uri in the
>photo-gallery.composite and it seems that we can treat this issue by
>surrounding the code that process each album with a try/catch like :
>
>if (albumFeed != null) {
> try {
> for(org.apache.abdera.model.Entry feedPicture :
>albumFeed.getFeed().getEntries()) {
> String feedImageLink =
>feedPicture.getEnclosureLinkResolvedHref().toString();
> pictures.add(feedImageLink);
> }
> }catch (Exception e) {
> //log exception, warn user that album xxx was not processed (not found)
> }
>}
>
>
>
>Please let me know if this is the same issue you were seeing, and if
>this solve your problem... I';; commit these changes in a few minutes
>
>
>--
>Luciano Resende
>Apache Tuscany, Apache PhotArk
>http://people.apache.org/~lresende
>http://lresende.blogspot.com/