nomad
nomad copied to clipboard
client stats endpoint returns 500 and not 404 for "unknown node" error
In the /v1/client/allocation/stats endpoint, we catch "unknown allocation" and "no path to node" RPC errors correctly and return 404. We don't catch the "unknown node" error and instead return 500.
Ideally we'd fix this upstream by adding the CodedError method in the RPC handler, rather than catching it in the HTTP handler. There are likely other cases of this in the allocation API.