 	renameEntity: (project_id, entity_id, entityType, newName, userId, callback)->
 		# check if name is allowed
 		if not SafePath.isCleanFilename newName
-			return callback new Error("invalid element name")
+			return callback new Errors.InvalidNameError("invalid element name")
 		logger.log(entity_id: entity_id, project_id: project_id, ('renaming '+entityType))
 		if !entityType?
 			logger.err err: "No entityType set", project_id: project_id, entity_id: entity_id

	addFileWithoutUpdatingHistory: (project_id, folder_id, fileName, path, userId, callback = (error, fileRef, folder_id, path, fileStoreUrl) ->)->
		# check if file name is allowed
		if not SafePath.isCleanFilename fileName
			return callback new Error("invalid element name")
		ProjectGetter.getProject project_id, {rootFolder:true, name:true}, (err, project) ->
			if err?
				logger.err project_id:project_id, err:err, "error getting project for add file"

	restoreDoc: (project_id, doc_id, name, callback = (error, doc, folder_id) ->) ->
		# check if docname is allowed (passed in from client so we check it)
		if not SafePath.isCleanFilename name
			return callback new Errors.InvalidNameError("invalid element name")
		# getDoc will return the deleted doc's lines, but we don't actually remove
		# the deleted doc, just create a new one from its lines.
		ProjectEntityHandler.getDoc project_id, doc_id, include_deleted: true, (error, lines) ->
