diff options
author | Matthias Held <ilovemilk@wusa.io> | 2018-08-29 13:53:48 +0300 |
---|---|---|
committer | Matthias Held <ilovemilk@wusa.io> | 2018-08-29 13:53:48 +0300 |
commit | 64bf5d144284392c60dafe3e80114bc4edcf1aa3 (patch) | |
tree | a4247a1cf4bcf3da63a89c86977df10d9e0d8b96 /js | |
parent | 7b90b4ba0e1027ad0f9b0572aafacff68f0014ce (diff) |
Improve error handling of missing files or wrong paths
Diffstat (limited to 'js')
-rw-r--r-- | js/scan.js | 28 |
1 files changed, 15 insertions, 13 deletions
@@ -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; |