You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Ian Boston (JIRA)" <ji...@apache.org> on 2008/08/28 23:27:44 UTC

[jira] Commented: (SHINDIG-549) Use exceptions instead of ResponseItem to signal service errors

    [ https://issues.apache.org/jira/browse/SHINDIG-549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626752#action_12626752 ] 

Ian Boston commented on SHINDIG-549:
------------------------------------

Patch is Ok, but I am getting a license header failure from the rat report 
 AL    /Users/ieb/Apache/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/spi/PersonService.java
  AL    /Users/ieb/Apache/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/spi/RestfulCollection.java
 !????? /Users/ieb/Apache/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/spi/RestfulItem.java
  AL    /Users/ieb/Apache/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/spi/SocialSpiException.java
  AL    /Users/ieb/Apache/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/spi/UserId.java

Its probably something simple I can fix locally before commit.

> Use exceptions instead of ResponseItem to signal service errors
> ---------------------------------------------------------------
>
>                 Key: SHINDIG-549
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-549
>             Project: Shindig
>          Issue Type: Improvement
>          Components: RESTful API (Java)
>            Reporter: Adam Winer
>         Attachments: shindig-549-2.patch, shindig-549.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> As discussed on shindig-dev:
> (1) Get error code and message out of
> RestfulItem/RestfulCollection/DataCollection and into an exception,
> so:
> PersonService {
>  Future<RestfulCollection<Person>> getPeople(...);
>  Future<RestfulItem<Person>> getPerson(...);
> }
> becomes:
> PersonService {
>  // Note: the Future may also throw a SocialApiException (wrapped in
> an EvaluationException)
>  Future<RestfulCollection<Person>> getPeople(...) throws SocialApiException
>  Future<Person> getPerson(...) throws SocialApiException
> }
> RestfulItem goes away entirely, and RestfulCollection doesn't extend
> ResponseItem.  ResponseItem can entirely disappear from the SPI, and
> can move out of org.apache.shindig.social and into
> o.a.s.s.opensocial.service alongside of RequestItem.
> One advantage of this change is that it makes it easy to write generic
> preconditions across datatypes, and gets rid of early returns from
> service implementations, which are a bit of a code smell.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.