Catch path alias scaling (#1057)

* Catch path alias scaling

* Better wording

* Fix grammar mistake
This commit is contained in:
Tim Neutkens
2018-01-03 20:52:27 +01:00
committed by Leo Lamprecht
parent c93eed08fc
commit 0d8b4a8386
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
# Scaling path alias
#### Why This Error Occurred
You tried to use `now scale` on a path alias (`now alias -r rules.json`).
#### Possible Ways to Fix It
Path aliases are routes to instances. Instances can be scaled independent from each other.
You can view path aliases by running `now alias ls <id>`.
Documentation for Path Aliases can be found [here](https://zeit.co/docs/features/path-aliases).

View File

@@ -195,6 +195,13 @@ async function run({ token, sh: { currentTeam } }) {
console.error(error(`Could not find any deployments matching ${id}`))
return process.exit(1)
}
// Alias is a path alias, these can't be scaled.
if(aliasDeployment.rules && aliasDeployment.rules.length > 0) {
console.error(error(`Requested identifier is a path alias. https://err.sh/now-cli/scaling-path-alias`))
return process.exit(1)
}
match = deployments.find(d => {
return d.uid === aliasDeployment.deploymentId
})