give separate error for archive in progress vs completed

This commit is contained in:
Brian Gough 2016-03-09 14:33:19 +00:00
parent 7350ab531d
commit f6367e21b8

View file

@ -407,10 +407,12 @@ module.exports = PackManager =
PackManager.getPackFromIndex doc_id, pack_id, (err, result) ->
return callback(err) if err?
return callback new Error("pack not found in index") if not result?
if result.inS3?
callback new Error("pack archiving already in progress")
if result.inS3
return callback new Error("pack archiving already done")
else if result.inS3?
return callback new Error("pack archiving already in progress")
else
callback()
return callback()
markPackAsArchiveInProgress: (project_id, doc_id, pack_id, callback) ->
logger.log {project_id, doc_id}, "marking pack as archive in progress status"