 			EditorController.addFileWithoutLock project_id, folder_id, fileName, path, source, (error, file)->
 				LockManager.releaseLock project_id, ->
 					callback(error, file)	
-
 
 	addFileWithoutLock: (project_id, folder_id, fileName, path, source, callback = (error, file)->)->
 		fileName = fileName.trim()
 		logger.log {project_id, folder_id, fileName, path}, "sending new file to project"
 		Metrics.inc "editor.add-file"
 		ProjectEntityHandler.addFile project_id, folder_id, fileName, path, (err, fileRef, folder_id)=>
+			if err?
+				logger.err err:err, project_id:project_id, folder_id:folder_id, fileName:fileName, "error adding file without lock"
+				return callback(err)
 			EditorRealTimeController.emitToRoom(project_id, 'reciveNewFile', folder_id, fileRef, source)
 			callback(err, fileRef)
 
 	replaceFile: (project_id, file_id, fsPath, source, callback = (error) ->)->
 		ProjectEntityHandler.replaceFile project_id, file_id, fsPath, callback
-
-
 
 	addFolder : (project_id, folder_id, folderName, source, callback = (error, folder)->)->
 		LockManager.getLock project_id, (err)->

	mkdirpWithoutLock: (project_id, path, callback)->
		logger.log project_id:project_id, path:path, "making directories if they don't exist"
		ProjectEntityHandler.mkdirp project_id, path, (err, newFolders, lastFolder)=>
			self = @
			jobs = _.map newFolders, (folder, index)->
				return (cb)->

		logger.log {project_id, folder_id, folderName, source}, "sending new folder to project"
		Metrics.inc "editor.add-folder"
		ProjectEntityHandler.addFolder project_id, folder_id, folderName, (err, folder, folder_id)=>
			if err?
				logger.err err:err, project_id:project_id, folder_id:folder_id, folderName:folderName, "error adding folder without lock"
				return callback(err)
			@p.notifyProjectUsersOfNewFolder project_id, folder_id, folder, (error) ->
				callback error, folder

