kylin-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From " Kaige Liu (JIRA)" <>
Subject [jira] [Commented] (KYLIN-3146) Response code and exception should be standardised for cube checking
Date Wed, 03 Jan 2018 03:07:00 GMT


 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|]:
{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:
>             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*,

This message was sent by Atlassian JIRA

View raw message