Add status code into error responses from REST API calls

Description

When building language-specific clients based on the REST API, there is currently no way to have fine-grained exceptions for the REST API calls. For example, when creating a directory, the language-specify client should differentiate the error caused by an existing directory from the error causes by HTTP connection timeout.

This is because the REST API calls only return the HTTP status code and a string message when it fails. If a json encoded error response like {"status": "XXX", "message": "XXX"} is returned instead of the pure message, then language-specific clients can throw different exceptions based on the "status" field.

Environment

None

Status

Assignee

Cheng Chang

Reporter

Cheng Chang

Labels

Components

Fix versions

Affects versions

Priority

Major
Configure