Handle invalid candidate versions on server side.

This commit is contained in:
Marco Vermeulen
2012-10-09 12:36:37 +01:00
parent 0f96542e42
commit eeb59c4d7b
2 changed files with 3 additions and 3 deletions

View File

@@ -35,7 +35,7 @@ function determine_candidate_version {
if [ "$VERSION" == "invalid" ]; then
echo ""
echo "Stop! $1 is not a valid grails version."
echo "Stop! $1 is not a valid $CANDIDATE version."
exit 0
fi
}

View File

@@ -41,13 +41,13 @@ rm.get("/candidates/:candidate") { req ->
def candidate = req.params['candidate']
def versions = buildCsv(candidates[candidate])?.toString()
addPlainTextHeader req
req.response.end (versions ?: "")
req.response.end (versions ?: "invalid")
}
rm.get("/candidates/:candidate/default") { req ->
def candidate = req.params['candidate']
addPlainTextHeader req
req.response.end defaults[candidate]
req.response.end (defaults[candidate] ?: "")
}
rm.get("/candidates/:candidate/list") { req ->