Making a POST request to the Snapd REST API with a snap name that it cannot find results in a 500 error and an uninformative message:
# curl -sS --unix-socket /run/snapd.socket http://localhost/v2/snaps -X POST \ -d '{"action": "install", "snaps": ["spanandeggs", "hello"]}' -H "Content-Type: application/json" \ | jq { "type": "error", "status-code": 500, "status": "Internal Server Error", "result": { "message": "store.SnapNotFound with 2 snaps" } }
404 is probably a more valuable HTTP response code, but I'm more concerned that there's no indication of which snap was not found.
Making a POST request to the Snapd REST API with a snap name that it cannot find results in a 500 error and an uninformative message:
# curl -sS --unix-socket /run/snapd.socket http:// localhost/ v2/snaps -X POST \
-d '{"action": "install", "snaps": ["spanandeggs", "hello"]}' -H "Content-Type: application/json" \
| jq
{
"type": "error",
"status-code": 500,
"status": "Internal Server Error",
"result": {
"message": "store.SnapNotFound with 2 snaps"
}
}
404 is probably a more valuable HTTP response code, but I'm more concerned that there's no indication of which snap was not found.