From 3452a9870e153a8726f87a6990f2a48f66f28d27 Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 24 May 2016 15:10:55 +0100 Subject: [PATCH] Show logs when compile fails correctly --- .../coffee/ide/pdf/controllers/PdfController.coffee | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 4db21cd6f3..15c3e34664 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -48,6 +48,11 @@ define [ $scope.pdf.tooRecentlyCompiled = false $scope.pdf.renderingError = false + # make a cache to look up files by name + fileByPath = {} + for file in response.outputFiles + fileByPath[file.path] = file + if response.status == "timedout" $scope.pdf.view = 'errors' $scope.pdf.timedout = true @@ -60,7 +65,7 @@ define [ $scope.pdf.view = 'errors' $scope.pdf.failure = true $scope.shouldShowLogs = true - fetchLogs() + fetchLogs(fileByPath['output.log'], fileByPath['output.blg']) else if response.status == 'clsi-maintenance' $scope.pdf.view = 'errors' $scope.pdf.clsiMaintenance = true @@ -71,10 +76,6 @@ define [ $scope.pdf.view = 'pdf' $scope.shouldShowLogs = false - # make a cache to look up files by name - fileByPath = {} - for file in response.outputFiles - fileByPath[file.path] = file # prepare query string qs = {} # define the base url. if the pdf file has a build number, pass it to the clsi in the url @@ -123,6 +124,7 @@ define [ fetchLogs = (logFile, blgFile) -> getFile = (name, file) -> + console.log "[getFile]", name, file opts = method:"GET" params: