databend icon indicating copy to clipboard operation
databend copied to clipboard

http query api: the response body of "query id not found" is not in JSON format

Open flaneur2020 opened this issue 3 years ago โ€ข 3 comments

Summary

on errors of the http api, it returns an error format like:

{
  "error": {
    "code": xx
    "message": xxx
  }
}

but the output of query id not found is not an json, but a plain string:

https://github.com/datafuselabs/databend/blob/7385f416059bc7d5bc4eaa9c77c5d01cf659c197/query/src/servers/http/v1/http_query_handlers.rs#L268

it might be better to return the query id not found error in the uniform format.

flaneur2020 avatar Jun 21 '22 11:06 flaneur2020

so you mean returning a JSON string like:

{
  "error": {
    "id": "$query_id",
    "message": "query id not found"
  }
}

wrapped in an HTTP 404 response?

ClSlaid avatar Jun 25 '22 08:06 ClSlaid

so you mean returning a JSON string like:

{
  "error": {
    "id": "$query_id",
    "message": "query id not found"
  }
}

wrapped in an HTTP 404 response?

indeed๏ผŒthe query api have a uniformed error representation, we can keep the error body the same with the other errors.

flaneur2020 avatar Jul 11 '22 05:07 flaneur2020

Is this issue still valid? What action should we need to take?

Xuanwo avatar Sep 16 '22 06:09 Xuanwo