[ 
https://issues.apache.org/jira/browse/USERGRID-216?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

George Reyes closed USERGRID-216.
---------------------------------

Instead of using a ServiceResourceNotFoundException in the cases where we were 
returning a null entity I used a EntityNotFoundException. That way the response 
error is clearer and we return the 404 if entity isn't found. 

> GET an non-exists entity by ID or Name throws 401 if no authorisation is 
> required
> ---------------------------------------------------------------------------------
>
>                 Key: USERGRID-216
>                 URL: https://issues.apache.org/jira/browse/USERGRID-216
>             Project: Usergrid
>          Issue Type: Story
>            Reporter: Strong Liu
>            Assignee: George Reyes
>             Fix For: 2.1.0
>
>
> for example
> get /sandbox/users/non-exist-username throws 401 error code
> this is because below code
> {code}
> @Provider
> public class ServiceResourceNotFoundExceptionMapper extends 
> AbstractExceptionMapper<ServiceResourceNotFoundException> {
>     @Override
>     public Response toResponse( ServiceResourceNotFoundException e ) {
>         if ( SubjectUtils.getSubjectUserId() == null ) {
>             return toResponse( UNAUTHORIZED, e );
>         }
>         else {
>             return toResponse( NOT_FOUND, e );
>         }
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to