0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Added extra handling for test port conflict errors

- If you use ghost cli, you may have extra ghost instances running on 2369
- Add extra handling to make this case super clear next time it happens to someone (probably me)
This commit is contained in:
Hannah Wolfe 2019-11-06 12:48:58 +07:00
parent 814bb7da55
commit 27dd442059

View file

@ -98,7 +98,12 @@ const login = (request, API_URL) => {
password: 'Sl1m3rson99'
})
.then(function then(res) {
if (res.statusCode !== 200 && res.statusCode !== 201) {
if (res.statusCode === 302) {
// This can happen if you already have an instance running e.g. if you've been using Ghost CLI recently
return reject(new common.errors.GhostError({
message: 'Ghost is redirecting, do you have an instance already running on port 2369?'
}));
} else if (res.statusCode !== 200 && res.statusCode !== 201) {
return reject(new common.errors.GhostError({
message: res.body.errors[0].message
}));