Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/undo-ransomware/ransomware_detection.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorMatthias Held <ilovemilk@wusa.io>2018-08-29 13:53:48 +0300
committerMatthias Held <ilovemilk@wusa.io>2018-08-29 13:53:48 +0300
commit64bf5d144284392c60dafe3e80114bc4edcf1aa3 (patch)
treea4247a1cf4bcf3da63a89c86977df10d9e0d8b96 /js
parent7b90b4ba0e1027ad0f9b0572aafacff68f0014ce (diff)
Improve error handling of missing files or wrong paths
Diffstat (limited to 'js')
-rw-r--r--js/scan.js28
1 files changed, 15 insertions, 13 deletions
diff --git a/js/scan.js b/js/scan.js
index 1412c08..8d864ce 100644
--- a/js/scan.js
+++ b/js/scan.js
@@ -229,19 +229,21 @@
}).done(function(response) {
count = count + 1;
$('#scanned').text(count);
- self.$section[index] = self._createSection(index);
- self.$table[index] = self._createTableSkeleton(index, response.suspicion_score);
- self.$fileList[index] = self.$table[index].find('tbody.file-list');
- self.files[index] = [];
- $.each(response.sequence, function(i, file) {
- self.files[index][file.id] = file;
- self.$fileList[index].append(self._createFileRow(file, index));
- self.$el.find('#section-suspicious-files-text').remove();
- self.$el.find('#scan-results').show();
- });
- self.$section[index].append(self.$table[index]);
- self.$el.append(self.$section[index]);
- self.updateSelectionSummary(index);
+ if (response.status === "success") {
+ self.$section[index] = self._createSection(index);
+ self.$table[index] = self._createTableSkeleton(index, response.suspicion_score);
+ self.$fileList[index] = self.$table[index].find('tbody.file-list');
+ self.files[index] = [];
+ $.each(response.sequence, function(i, file) {
+ self.files[index][file.id] = file;
+ self.$fileList[index].append(self._createFileRow(file, index));
+ self.$el.find('#section-suspicious-files-text').remove();
+ self.$el.find('#scan-results').show();
+ });
+ self.$section[index].append(self.$table[index]);
+ self.$el.append(self.$section[index]);
+ self.updateSelectionSummary(index);
+ }
}).fail(function(response, code) {
console.log("Scan failed.");
count = count + 1;