Several of the bookkeeper services return Http status 417 (Expectation Failed), which isn't consistent with the error that occurred.
Consider using one of these Http status codes:
- 404 Not Found
- 500 Internal Server Error
- 503 Service Unavailable
Here is a sample request/response:
GET /bookkeeper/v1/quotas?quotaType=portal&subscribers=foo&requestor=http://orcid.org/0000-0002-2192-403X HTTP/1.1
{"code":417,"message":"The requested quotas couldn't be listed: http://orcid.org/0000-0002-2192-403X requested subscribers that don't exist or requestor doesn't have privilege to view them."}
For this case, where there was not an internal error (e.g. no SQL Error), status 404 seems the most appropriate.
In other instances, 417 is returned if any exception is thrown. In these cases, 500 may be more appropriate.
Several of the bookkeeper services return Http status 417 (Expectation Failed), which isn't consistent with the error that occurred.
Consider using one of these Http status codes:
Here is a sample request/response:
For this case, where there was not an internal error (e.g. no SQL Error), status 404 seems the most appropriate.
In other instances, 417 is returned if any exception is thrown. In these cases, 500 may be more appropriate.