Merge pull request #1916 from overleaf/ta-join-project-404

Return 404 on JoinProject When Project Is Not Found

GitOrigin-RevId: cd87ce6e2564fd4a80faa66e8b22edec7b0c783c
This commit is contained in:
Brian Gough
2019-07-01 09:25:41 +00:00
committed by sharelatex
parent 0e52453931
commit cf940cc835
2 changed files with 23 additions and 2 deletions
@@ -28,6 +28,7 @@ const CollaboratorsInviteHandler = require('../Collaborators/CollaboratorsInvite
const PrivilegeLevels = require('../Authorization/PrivilegeLevels')
const TokenAccessHandler = require('../TokenAccess/TokenAccessHandler')
const AuthenticationController = require('../Authentication/AuthenticationController')
const Errors = require('../Errors/Errors')
module.exports = EditorHttpController = {
joinProject(req, res, next) {
@@ -73,7 +74,7 @@ module.exports = EditorHttpController = {
return callback(error)
}
if (project == null) {
return callback(new Error('not found'))
return callback(new Errors.NotFoundError('project not found'))
}
return CollaboratorsHandler.getInvitedMembersWithPrivilegeLevels(
project_id,