diff options
author | brantje <brantje@gmail.com> | 2016-10-04 19:15:40 +0300 |
---|---|---|
committer | brantje <brantje@gmail.com> | 2016-10-04 19:15:40 +0300 |
commit | 713013caa7069336b3f5e638e38d27bedad1d8f3 (patch) | |
tree | 793632eb501271105f5a493a4de8c38966ad75f0 /js/app/services/credentialservice.js | |
parent | db819771d8c1a9f93d630568daff59aa406303a4 (diff) |
Catch some errors
Diffstat (limited to 'js/app/services/credentialservice.js')
-rw-r--r-- | js/app/services/credentialservice.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/js/app/services/credentialservice.js b/js/app/services/credentialservice.js index f432d529..7fb793d8 100644 --- a/js/app/services/credentialservice.js +++ b/js/app/services/credentialservice.js @@ -68,10 +68,7 @@ angular.module('passmanApp') var fieldValue = angular.copy(credential[field]); _credential[field] = EncryptService.encryptString(JSON.stringify(fieldValue)); } - } else { - console.log('Skipping encryption') } - _credential.expire_time = new Date( angular.copy(credential.expire_time) ).getTime() / 1000; var queryUrl = OC.generateUrl('apps/passman/api/v2/credentials/' + credential.credential_id); @@ -115,6 +112,7 @@ angular.module('passmanApp') for (var i = 0; i < _encryptedFields.length; i++) { var field = _encryptedFields[i]; var fieldValue = angular.copy(credential[field]); + try { var field_decrypted_value = EncryptService.decryptString(fieldValue) } catch (e){ @@ -125,7 +123,7 @@ angular.module('passmanApp') credential[field] = JSON.parse(field_decrypted_value); } catch (e){ console.log('Field' + field + ' in '+ credential.label +' could not be parsed! Value:'+ fieldValue) - throw e + } } |