Thanks for clarifying. In the case of the 500, is it possible to expose the 
causing error instead of “internal server error”? Or at least “internal server 
error: <cause>”?

From: Dinithi De Silva [mailto:dinit...@wso2.com]
Sent: 23 April 2015 12:16
To: Shaheedur Haque (shahhaqu)
Cc: dev; Vanson Lim (vlim); Martin Eppel (meppel); Imesh Gunaratne
Subject: Re: Re-factoring REST API

Hi,

This modification will expose the error status as 400 bad request, 404 not 
found or 500 internal server error other than sending 400 bad request for every 
server-side error.

Thanks.

On Thu, Apr 23, 2015 at 2:24 PM, Shaheedur Haque (shahhaqu) 
<shahh...@cisco.com<mailto:shahh...@cisco.com>> wrote:
In general, this is an excellent idea. (We may have a small adaptation to make 
on our side when this lands, but it will be worth it).

Will the effect of moving away from the RestApiException be to expose the 
underlying error? What would that look like in JSON terms?

From: Dinithi De Silva [mailto:dinit...@wso2.com<mailto:dinit...@wso2.com>]
Sent: 23 April 2015 09:48
To: dev
Cc: Vanson Lim (vlim); Shaheedur Haque (shahhaqu); Martin Eppel (meppel); Imesh 
Gunaratne
Subject: Re: Re-factoring REST API

Hi,

I have listed the changes in a point form below.


  *   In all the API methods the response message format will be changed to 
display a status message either with "Success" or "Error" . Status code will be 
removed from the response message.
Eg:

Current format
return Response.status(Response.Status.CONFLICT).entity(new 
ErrorResponseBean(Response.Status.CONFLICT.getStatusCode(), msg)).build();

After the modifications
return Response.status(Response.Status.CONFLICT).entity(new 
StatusResponseBean(Constants.STATUS_ERROR, msg)).build();



  *   The following non API methods found in StratosAPIV41 class will be moved 
to the StratosAPIV41Util class.

activateTenant(String)
addTenant(TenantInfoBean)
deactivateTenant(String)
getPartialSearchTenants(String)
getTenantForDomain(String)
getTenants()
removeTenant(String)
updateTenant(TenantInfoBean)

addUser(UserInfoBean)
getUsers()
removeUser(String)
updateUser(UserInfoBean)



  *   Removing 204 NO_CONTENT status code
204 NO_CONTENT status code will be removed from removeKubernetesHostCluster API 
method.


  *   Resolving problems in exception throwing and validating requests.
In this modifications we plan to give custom exceptions when needed other than 
throwing RestAPIException.


Thank you

--
Dinithi De Silva
Associate Software Engineer, WSO2 Inc.
m:+94716667655<tel:%2B94716667655> | 
e:dinit...@wso2.com<mailto:dinit...@wso2.com> | w: 
www.wso2.com<http://www.wso2.com>
| a: #20, Palm Grove, Colombo 03



--
Dinithi De Silva
Associate Software Engineer, WSO2 Inc.
m:+94716667655 | e:dinit...@wso2.com<mailto:dinit...@wso2.com> | w: 
www.wso2.com<http://www.wso2.com>
| a: #20, Palm Grove, Colombo 03

Reply via email to