 	_checkAuth: (project_id, data, current_user_id, callback = (err, allowed)->) ->
 		callback = _.once(callback)
 		if !@_validate(data)
-			return callback(new LinkedFilesErrors.BadDataError())
+			return callback(new BadDataError())
 		@_getSourceProject data, (err, project) ->
 			return callback(err) if err?
 			AuthorizationManager.canUserReadProject current_user_id,

ClsiManager = require '../Compile/ClsiManager'
ProjectFileAgent = require './ProjectFileAgent'
_ = require "underscore"
LinkedFilesErrors = require './LinkedFilesErrors'
LinkedFilesHandler = require './LinkedFilesHandler'
logger = require 'logger-sharelatex'


				(err, status, outputFiles) ->
					return callback(err) if err?
					if status != 'success'
						return callback(new OutputFileFetchFailedError())
					outputFile = _.find(
						outputFiles,
						(o) => o.path == source_output_file_path
					)
					if !outputFile?
						return callback(new OutputFileFetchFailedError())
					build_id = outputFile.build
					ClsiManager.getOutputFileStream source_project_id,
						user_id,
