Review feedback

This commit is contained in:
Alfonso Acosta
2016-03-03 12:35:04 +00:00
parent 579001059a
commit b9393e9e39
2 changed files with 8 additions and 8 deletions

View File

@@ -34,10 +34,10 @@ func checkPipe(pr PipeRouter, end End) CtxHandlerFunc {
id := mux.Vars(r)["pipeID"]
_, _, ok := pr.Get(ctx, id, end)
if !ok {
http.NotFound(w, r)
w.WriteHeader(http.StatusNoContent)
return
}
defer pr.Release(ctx, id, end)
pr.Release(ctx, id, end)
}
}

View File

@@ -218,17 +218,17 @@ export function getPipeStatus(pipeId) {
reqwest({
method: 'GET',
url: url,
success: function(res) {
log('ERROR: expected responses: [200, 404]. Got:', res);
},
error: function(err) {
log('ERROR: unexpected response:', err);
},
success: function(res) {
const status = {
200: 'PIPE_ALIVE',
404: 'PIPE_DELETED'
}[err.status];
204: 'PIPE_DELETED'
}[res.status];
if (!status) {
log('Unexpected pipe status:', err.status);
log('Unexpected pipe status:', res.status);
return;
}