[ 
https://issues.apache.org/jira/browse/KYLIN-3146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16309084#comment-16309084
 ] 

 Kaige Liu commented on KYLIN-3146:
-----------------------------------

I think if we narrow the scope to REST API, 404 might be a better choice for 
"cube not found". Cube name is part of URI, a 404 error will give client a 
clear hint. 

According to [RFC2616|https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html]:
{quote}10.4.1 400 Bad Request
The request could not be understood by the server due to malformed syntax. The 
client SHOULD NOT repeat the request without modifications.{quote}

{quote}10.4.5 404 Not Found
The server has not found anything matching the Request-URI. No indication is 
given of whether the condition is temporary or permanent. The 410 (Gone) status 
code SHOULD be used if the server knows, through some internally configurable 
mechanism, that an old resource is permanently unavailable and has no 
forwarding address. This status code is commonly used when the server does not 
wish to reveal exactly why the request has been refused, or when no other 
response is applicable.{quote}

> Response code and exception should be standardised for cube checking   
> -----------------------------------------------------------------------
>
>                 Key: KYLIN-3146
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3146
>             Project: Kylin
>          Issue Type: Improvement
>            Reporter:  Kaige Liu
>            Assignee:  Kaige Liu
>            Priority: Minor
>
> Checking if cubes exist or not is a common behaviour in some APIs. But we 
> have lots of different responses for the same behaviour.
> Let's take CubeController as an example. When can not find a cube with its 
> name, someone gives a *400* as response code, someone returns *404*, and 
> others send back a *500*. Not only HTTP response code is not standard, which 
> kind of exception should be thrown is not unified as well. Still using the 
> above example, we can find *IllegalArgumentException*, *BadRequestException*, 
> *InternalErrorException*.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to