Suppress verbose error in certificateStore

This commit is contained in:
Yuya Ochiai
2016-10-26 00:40:53 +09:00
parent 56e6fea525
commit 682c45aeab
2 changed files with 10 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ Release date: TBD
### Improvements ### Improvements
- "Cannot connect to Mattermost" is now on top of the page - "Cannot connect to Mattermost" is now on top of the page
- Suppressed verbose error which is related to certificates
#### Windows #### Windows
- Copying a links address and pasting it inside the app now works - Copying a links address and pasting it inside the app now works

View File

@@ -26,11 +26,18 @@ function getHost(targetURL) {
var CertificateStore = function(storeFile) { var CertificateStore = function(storeFile) {
this.storeFile = storeFile; this.storeFile = storeFile;
let storeStr;
try { try {
this.data = JSON.parse(fs.readFileSync(storeFile, 'utf-8')); storeStr = fs.readFileSync(storeFile, 'utf-8')
} }
catch (e) { catch (e) {
console.log(e); storeStr = '{}';
}
try {
this.data = JSON.parse(storeStr);
}
catch (e) {
console.log('Error when parsing', storeFile, ':', e);
this.data = {}; this.data = {};
} }
}; };