diff --git a/core/server/errors.js b/core/server/errors.js index 5b4828f7ed..bb5964aa7f 100644 --- a/core/server/errors.js +++ b/core/server/errors.js @@ -60,6 +60,12 @@ var ghostErrors = { statusCode: 409, errorType: 'DisabledFeatureError', }, options)); + }, + UpdateCollisionError: function UpdateCollisionError(options) { + GhostError.call(this, _.merge({ + statusCode: 409, + errorType: 'UpdateCollisionError', + }, options)); } }; diff --git a/core/server/models/plugins/collision.js b/core/server/models/plugins/collision.js index 00a52bc635..fa43f8f487 100644 --- a/core/server/models/plugins/collision.js +++ b/core/server/models/plugins/collision.js @@ -55,7 +55,7 @@ module.exports = function (Bookshelf) { if (Object.keys(changed).length) { if (clientUpdatedAt.diff(serverUpdatedAt) !== 0) { - return Promise.reject(new errors.InternalServerError({ + return Promise.reject(new errors.UpdateCollisionError({ message: 'Saving failed! Someone else is editing this post.', code: 'UPDATE_COLLISION' }));