|
|
@ -55,10 +55,14 @@ var loadReport = function (app, options, callback) { |
|
|
|
return callback("ReportFileNotFound", options); |
|
|
|
return callback("ReportFileNotFound", options); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fs.readFile(reportFile, function (err, data) { |
|
|
|
fs.readFile(reportFile, function (err, dataBuffer) { |
|
|
|
if (err) { |
|
|
|
if (err) { |
|
|
|
return callback(err, options); |
|
|
|
return callback(err, options); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var data = dataBuffer.toString(); |
|
|
|
|
|
|
|
if (!data) { |
|
|
|
|
|
|
|
return callback("ReportFileNotFound", options); |
|
|
|
|
|
|
|
} |
|
|
|
options.report = JSON.parse(data); |
|
|
|
options.report = JSON.parse(data); |
|
|
|
return callback(null, options); |
|
|
|
return callback(null, options); |
|
|
|
}); |
|
|
|
}); |
|
|
|