On Sat, May 9, 2015 at 10:22 PM, imesh <g...@git.apache.org> wrote:

> Github user imesh commented on a diff in the pull request:
>
>     https://github.com/apache/stratos/pull/296#discussion_r29994291
>
>     --- Diff:
> components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
> ---
>     @@ -441,7 +441,7 @@ public Response removeCartridge(
>
>  @AuthorizationAction("/permission/protected/manage/addServiceGroup")
>          @SuperTenantService(true)
>          public Response addServiceGroup(
>     -            GroupBean serviceGroupDefinition) throws RestAPIException
> {
>     +            GroupBean serviceGroupDefinition) throws
> RestAPIException, InvalidCartridgeGroupDefinitionException {
>     --- End diff --
>
>     Is it required to throw InvalidCartridgeGroupDefinitionException from
> this API method? If so there should be an exception handler which captures
> it and generate an error response to the client. IMO API methods should
> only throw RestAPIException.
>

+1. API method should only throw RestAPIException. We need to catch the
other custom exceptions and wrap those into the RestAPIException

>
>
> ---
> If your project is set up for it, you can reply to this email and have your
> reply appear on GitHub as well. If your project does not have this feature
> enabled and wishes so, or if the feature is enabled but not working, please
> contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
> with INFRA.
> ---
>



-- 

Gayan Gunarathne
Technical Lead
WSO2 Inc. (http://wso2.com)
email  : gay...@wso2.com  | mobile : +94 766819985

Reply via email to