From 92baed49c0b6780fbd55ebb2e0fb9b1ee13e220e Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Fri, 20 Nov 2015 21:46:04 +0000 Subject: Better error handling for view/tail/download and fix download to use proper cfe for input --- logfiles-controller.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'logfiles-controller.lua') diff --git a/logfiles-controller.lua b/logfiles-controller.lua index 54548be..b4c1cc4 100644 --- a/logfiles-controller.lua +++ b/logfiles-controller.lua @@ -18,10 +18,13 @@ mymodule.view = function (self) end mymodule.download = function (self) - local filestatus = mymodule.view(self) - local filecontent = filestatus.value.filecontent - filecontent.label = posix.basename(filestatus.value.filename.value) - return filecontent + local filedetails = mymodule.view(self) + local filecontent = filedetails.value.filecontent + if filecontent then + filecontent.type = "raw" + filecontent.label = posix.basename(filedetails.value.filename.value) + end + return filedetails end mymodule.tail = function (self) -- cgit v1.2.3