From f09fb69882525b3be7b2e257e7723eeb79b343d1 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Tue, 19 Oct 2021 10:32:14 +0200 Subject: [PATCH] Remove empty catch blocks, and update tslint rule (#513) --- angular/src/components/add-edit.component.ts | 15 ++++++++--- .../src/components/attachments.component.ts | 15 ++++++++--- .../src/components/collections.component.ts | 7 +++-- angular/src/components/export.component.ts | 8 ++++-- .../components/folder-add-edit.component.ts | 11 +++++--- angular/src/components/hint.component.ts | 8 ++++-- angular/src/components/icon.component.ts | 4 ++- angular/src/components/lock.component.ts | 7 +++-- angular/src/components/login.component.ts | 8 ++++-- angular/src/components/premium.component.ts | 8 +++--- angular/src/components/register.component.ts | 8 ++++-- .../src/components/send/add-edit.component.ts | 12 ++++++--- angular/src/components/send/send.component.ts | 13 +++++++--- angular/src/components/share.component.ts | 7 +++-- angular/src/components/sso.component.ts | 7 +++-- .../src/components/two-factor.component.ts | 8 ++++-- .../update-temp-password.component.ts | 11 +++++--- angular/src/components/view.component.ts | 12 ++++++--- common/src/importers/passpackCsvImporter.ts | 8 ++++-- .../src/importers/passwordBossJsonImporter.ts | 4 ++- common/src/importers/rememBearCsvImporter.ts | 8 ++++-- common/src/importers/truekeyCsvImporter.ts | 4 ++- common/src/misc/utils.ts | 8 ++++-- common/src/models/view/attachmentView.ts | 4 ++- common/src/models/view/sendFileView.ts | 4 ++- .../src/services/azureFileUpload.service.ts | 4 ++- common/src/services/cipher.service.ts | 8 ++++-- common/src/services/crypto.service.ts | 4 ++- common/src/services/event.service.ts | 8 ++++-- common/src/services/notifications.service.ts | 4 ++- common/src/services/search.service.ts | 4 ++- common/src/services/sync.service.ts | 12 ++++++--- common/src/services/totp.service.ts | 16 +++++++++--- electron/src/biometric.windows.main.ts | 7 +++-- electron/src/window.main.ts | 26 +++++++++++++------ node/src/cli/commands/login.command.ts | 4 ++- spec/common/services/cipher.service.spec.ts | 5 +++- tslint.json | 2 +- 38 files changed, 228 insertions(+), 85 deletions(-) diff --git a/angular/src/components/add-edit.component.ts b/angular/src/components/add-edit.component.ts index f401bf93..3c6d0bc3 100644 --- a/angular/src/components/add-edit.component.ts +++ b/angular/src/components/add-edit.component.ts @@ -20,6 +20,7 @@ import { CollectionService } from 'jslib-common/abstractions/collection.service' import { EventService } from 'jslib-common/abstractions/event.service'; import { FolderService } from 'jslib-common/abstractions/folder.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { MessagingService } from 'jslib-common/abstractions/messaging.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { PolicyService } from 'jslib-common/abstractions/policy.service'; @@ -88,7 +89,7 @@ export class AddEditComponent implements OnInit { protected auditService: AuditService, protected stateService: StateService, protected userService: UserService, protected collectionService: CollectionService, protected messagingService: MessagingService, protected eventService: EventService, - protected policyService: PolicyService) { + protected policyService: PolicyService, private logService: LogService) { this.typeOptions = [ { name: i18nService.t('typeLogin'), value: CipherType.Login }, { name: i18nService.t('typeCard'), value: CipherType.Card }, @@ -283,7 +284,9 @@ export class AddEditComponent implements OnInit { this.onSavedCipher.emit(this.cipher); this.messagingService.send(this.editMode && !this.cloneMode ? 'editedCipher' : 'addedCipher'); return true; - } catch { } + } catch (e) { + this.logService.error(e); + } return false; } @@ -346,7 +349,9 @@ export class AddEditComponent implements OnInit { this.i18nService.t(this.cipher.isDeleted ? 'permanentlyDeletedItem' : 'deletedItem')); this.onDeletedCipher.emit(this.cipher); this.messagingService.send(this.cipher.isDeleted ? 'permanentlyDeletedCipher' : 'deletedCipher'); - } catch { } + } catch (e) { + this.logService.error(e); + } return true; } @@ -369,7 +374,9 @@ export class AddEditComponent implements OnInit { this.platformUtilsService.showToast('success', null, this.i18nService.t('restoredItem')); this.onRestoredCipher.emit(this.cipher); this.messagingService.send('restoredCipher'); - } catch { } + } catch (e) { + this.logService.error(e); + } return true; } diff --git a/angular/src/components/attachments.component.ts b/angular/src/components/attachments.component.ts index a4f6b65c..dcbaf19b 100644 --- a/angular/src/components/attachments.component.ts +++ b/angular/src/components/attachments.component.ts @@ -10,6 +10,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service'; import { CipherService } from 'jslib-common/abstractions/cipher.service'; import { CryptoService } from 'jslib-common/abstractions/crypto.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { UserService } from 'jslib-common/abstractions/user.service'; @@ -38,7 +39,7 @@ export class AttachmentsComponent implements OnInit { constructor(protected cipherService: CipherService, protected i18nService: I18nService, protected cryptoService: CryptoService, protected userService: UserService, protected platformUtilsService: PlatformUtilsService, protected apiService: ApiService, - protected win: Window) { } + protected win: Window, private logService: LogService) { } async ngOnInit() { await this.init(); @@ -71,7 +72,9 @@ export class AttachmentsComponent implements OnInit { this.cipher = await this.cipherDomain.decrypt(); this.platformUtilsService.showToast('success', null, this.i18nService.t('attachmentSaved')); this.onUploadedAttachment.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } // reset file input // ref: https://stackoverflow.com/a/20552042 @@ -100,7 +103,9 @@ export class AttachmentsComponent implements OnInit { if (i > -1) { this.cipher.attachments.splice(i, 1); } - } catch { } + } catch (e) { + this.logService.error(e); + } this.deletePromises[attachment.id] = null; this.onDeletedAttachment.emit(); @@ -226,7 +231,9 @@ export class AttachmentsComponent implements OnInit { a.downloading = false; }); await this.reuploadPromises[attachment.id]; - } catch { } + } catch (e) { + this.logService.error(e); + } } protected loadCipher() { diff --git a/angular/src/components/collections.component.ts b/angular/src/components/collections.component.ts index c8782ed7..29a846c6 100644 --- a/angular/src/components/collections.component.ts +++ b/angular/src/components/collections.component.ts @@ -9,6 +9,7 @@ import { import { CipherService } from 'jslib-common/abstractions/cipher.service'; import { CollectionService } from 'jslib-common/abstractions/collection.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { CipherView } from 'jslib-common/models/view/cipherView'; @@ -30,7 +31,7 @@ export class CollectionsComponent implements OnInit { protected cipherDomain: Cipher; constructor(protected collectionService: CollectionService, protected platformUtilsService: PlatformUtilsService, - protected i18nService: I18nService, protected cipherService: CipherService) { } + protected i18nService: I18nService, protected cipherService: CipherService, private logService: LogService) { } async ngOnInit() { await this.load(); @@ -65,7 +66,9 @@ export class CollectionsComponent implements OnInit { await this.formPromise; this.onSavedCollections.emit(); this.platformUtilsService.showToast('success', null, this.i18nService.t('editedItem')); - } catch { } + } catch (e) { + this.logService.error(e); + } } protected loadCipher() { diff --git a/angular/src/components/export.component.ts b/angular/src/components/export.component.ts index e492942d..3ea63dee 100644 --- a/angular/src/components/export.component.ts +++ b/angular/src/components/export.component.ts @@ -9,6 +9,7 @@ import { CryptoService } from 'jslib-common/abstractions/crypto.service'; import { EventService } from 'jslib-common/abstractions/event.service'; import { ExportService } from 'jslib-common/abstractions/export.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { PolicyService } from 'jslib-common/abstractions/policy.service'; @@ -27,7 +28,8 @@ export class ExportComponent implements OnInit { constructor(protected cryptoService: CryptoService, protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService, protected exportService: ExportService, - protected eventService: EventService, private policyService: PolicyService, protected win: Window) { } + protected eventService: EventService, private policyService: PolicyService, protected win: Window, + private logService: LogService) { } async ngOnInit() { await this.checkExportDisabled(); @@ -66,7 +68,9 @@ export class ExportComponent implements OnInit { this.downloadFile(data); this.saved(); await this.collectEvent(); - } catch { } + } catch (e) { + this.logService.error(e); + } } else { this.platformUtilsService.showToast('error', this.i18nService.t('errorOccurred'), this.i18nService.t('invalidMasterPassword')); diff --git a/angular/src/components/folder-add-edit.component.ts b/angular/src/components/folder-add-edit.component.ts index 3fe0dac1..554c743f 100644 --- a/angular/src/components/folder-add-edit.component.ts +++ b/angular/src/components/folder-add-edit.component.ts @@ -8,6 +8,7 @@ import { import { FolderService } from 'jslib-common/abstractions/folder.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { FolderView } from 'jslib-common/models/view/folderView'; @@ -25,7 +26,7 @@ export class FolderAddEditComponent implements OnInit { deletePromise: Promise; constructor(protected folderService: FolderService, protected i18nService: I18nService, - protected platformUtilsService: PlatformUtilsService) { } + protected platformUtilsService: PlatformUtilsService, private logService: LogService) { } async ngOnInit() { await this.init(); @@ -46,7 +47,9 @@ export class FolderAddEditComponent implements OnInit { this.i18nService.t(this.editMode ? 'editedFolder' : 'addedFolder')); this.onSavedFolder.emit(this.folder); return true; - } catch { } + } catch (e) { + this.logService.error(e); + } return false; } @@ -64,7 +67,9 @@ export class FolderAddEditComponent implements OnInit { await this.deletePromise; this.platformUtilsService.showToast('success', null, this.i18nService.t('deletedFolder')); this.onDeletedFolder.emit(this.folder); - } catch { } + } catch (e) { + this.logService.error(e); + } return true; } diff --git a/angular/src/components/hint.component.ts b/angular/src/components/hint.component.ts index addc2052..8ed7d6ed 100644 --- a/angular/src/components/hint.component.ts +++ b/angular/src/components/hint.component.ts @@ -4,6 +4,7 @@ import { PasswordHintRequest } from 'jslib-common/models/request/passwordHintReq import { ApiService } from 'jslib-common/abstractions/api.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; export class HintComponent { @@ -14,7 +15,8 @@ export class HintComponent { protected onSuccessfulSubmit: () => void; constructor(protected router: Router, protected i18nService: I18nService, - protected apiService: ApiService, protected platformUtilsService: PlatformUtilsService) { } + protected apiService: ApiService, protected platformUtilsService: PlatformUtilsService, + private logService: LogService) { } async submit() { if (this.email == null || this.email === '') { @@ -37,6 +39,8 @@ export class HintComponent { } else if (this.router != null) { this.router.navigate([this.successRoute]); } - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/angular/src/components/icon.component.ts b/angular/src/components/icon.component.ts index 7d4126c0..b3a75d5a 100644 --- a/angular/src/components/icon.component.ts +++ b/angular/src/components/icon.component.ts @@ -96,7 +96,9 @@ export class IconComponent implements OnChanges { try { this.image = this.iconsUrl + '/' + Utils.getHostname(hostnameUri) + '/icon.png'; this.fallbackImage = 'images/fa-globe.png'; - } catch (e) { } + } catch (e) { + // Ignore error since the fallback icon will be shown if image is null. + } } } else { this.image = null; diff --git a/angular/src/components/lock.component.ts b/angular/src/components/lock.component.ts index a488d97e..329dd0c6 100644 --- a/angular/src/components/lock.component.ts +++ b/angular/src/components/lock.component.ts @@ -5,6 +5,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service'; import { CryptoService } from 'jslib-common/abstractions/crypto.service'; import { EnvironmentService } from 'jslib-common/abstractions/environment.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { MessagingService } from 'jslib-common/abstractions/messaging.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { StateService } from 'jslib-common/abstractions/state.service'; @@ -47,7 +48,7 @@ export class LockComponent implements OnInit { protected userService: UserService, protected cryptoService: CryptoService, protected storageService: StorageService, protected vaultTimeoutService: VaultTimeoutService, protected environmentService: EnvironmentService, protected stateService: StateService, - protected apiService: ApiService) { } + protected apiService: ApiService, private logService: LogService) { } async ngOnInit() { this.pinSet = await this.vaultTimeoutService.isPinLockSet(); @@ -129,7 +130,9 @@ export class LockComponent implements OnInit { const localKeyHash = await this.cryptoService.hashPassword(this.masterPassword, key, HashPurpose.LocalAuthorization); await this.cryptoService.setKeyHash(localKeyHash); - } catch { } + } catch (e) { + this.logService.error(e); + } } if (passwordValid) { diff --git a/angular/src/components/login.component.ts b/angular/src/components/login.component.ts index d647e2ab..bfac5f53 100644 --- a/angular/src/components/login.component.ts +++ b/angular/src/components/login.component.ts @@ -12,6 +12,7 @@ import { AuthService } from 'jslib-common/abstractions/auth.service'; import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service'; import { EnvironmentService } from 'jslib-common/abstractions/environment.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { StateService } from 'jslib-common/abstractions/state.service'; @@ -49,7 +50,8 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit platformUtilsService: PlatformUtilsService, i18nService: I18nService, protected stateService: StateService, environmentService: EnvironmentService, protected passwordGenerationService: PasswordGenerationService, - protected cryptoFunctionService: CryptoFunctionService, private storageService: StorageService) { + protected cryptoFunctionService: CryptoFunctionService, private storageService: StorageService, + protected logService: LogService) { super(environmentService, i18nService, platformUtilsService); } @@ -123,7 +125,9 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit this.router.navigate([this.successRoute]); } } - } catch { } + } catch (e) { + this.logService.error(e); + } } togglePassword() { diff --git a/angular/src/components/premium.component.ts b/angular/src/components/premium.component.ts index b0ba3445..5b5b4c89 100644 --- a/angular/src/components/premium.component.ts +++ b/angular/src/components/premium.component.ts @@ -2,8 +2,8 @@ import { Directive, OnInit } from '@angular/core'; import { ApiService } from 'jslib-common/abstractions/api.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; -import { TokenService } from 'jslib-common/abstractions/token.service'; import { UserService } from 'jslib-common/abstractions/user.service'; @Directive() @@ -13,7 +13,7 @@ export class PremiumComponent implements OnInit { refreshPromise: Promise; constructor(protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService, - protected apiService: ApiService, protected userService: UserService) { } + protected apiService: ApiService, protected userService: UserService, private logService: LogService) { } async ngOnInit() { this.isPremium = await this.userService.canAccessPremium(); @@ -25,7 +25,9 @@ export class PremiumComponent implements OnInit { await this.refreshPromise; this.platformUtilsService.showToast('success', null, this.i18nService.t('refreshComplete')); this.isPremium = await this.userService.canAccessPremium(); - } catch { } + } catch (e) { + this.logService.error(e); + } } async purchase() { diff --git a/angular/src/components/register.component.ts b/angular/src/components/register.component.ts index aecf9ceb..fd91af29 100644 --- a/angular/src/components/register.component.ts +++ b/angular/src/components/register.component.ts @@ -10,6 +10,7 @@ import { AuthService } from 'jslib-common/abstractions/auth.service'; import { CryptoService } from 'jslib-common/abstractions/crypto.service'; import { EnvironmentService } from 'jslib-common/abstractions/environment.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { StateService } from 'jslib-common/abstractions/state.service'; @@ -39,7 +40,8 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn i18nService: I18nService, protected cryptoService: CryptoService, protected apiService: ApiService, protected stateService: StateService, platformUtilsService: PlatformUtilsService, - protected passwordGenerationService: PasswordGenerationService, environmentService: EnvironmentService) { + protected passwordGenerationService: PasswordGenerationService, environmentService: EnvironmentService, + protected logService: LogService) { super(environmentService, i18nService, platformUtilsService); this.showTerms = !platformUtilsService.isSelfHost(); } @@ -158,7 +160,9 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn } this.platformUtilsService.showToast('success', null, this.i18nService.t('newAccountCreated')); this.router.navigate([this.successRoute], { queryParams: { email: this.email } }); - } catch { } + } catch (e) { + this.logService.error(e); + } } togglePassword(confirmField: boolean) { diff --git a/angular/src/components/send/add-edit.component.ts b/angular/src/components/send/add-edit.component.ts index b4b5c927..70bd87ba 100644 --- a/angular/src/components/send/add-edit.component.ts +++ b/angular/src/components/send/add-edit.component.ts @@ -12,6 +12,7 @@ import { SendType } from 'jslib-common/enums/sendType'; import { EnvironmentService } from 'jslib-common/abstractions/environment.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { MessagingService } from 'jslib-common/abstractions/messaging.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { PolicyService } from 'jslib-common/abstractions/policy.service'; @@ -57,7 +58,8 @@ export class AddEditComponent implements OnInit { constructor(protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService, protected environmentService: EnvironmentService, protected datePipe: DatePipe, protected sendService: SendService, protected userService: UserService, - protected messagingService: MessagingService, protected policyService: PolicyService) { + protected messagingService: MessagingService, protected policyService: PolicyService, + private logService: LogService) { this.typeOptions = [ { name: i18nService.t('sendTypeFile'), value: SendType.File }, { name: i18nService.t('sendTypeText'), value: SendType.Text }, @@ -191,7 +193,9 @@ export class AddEditComponent implements OnInit { try { await this.formPromise; return true; - } catch { } + } catch (e) { + this.logService.error(e); + } return false; } @@ -218,7 +222,9 @@ export class AddEditComponent implements OnInit { await this.load(); this.onDeletedSend.emit(this.send); return true; - } catch { } + } catch (e) { + this.logService.error(e); + } return false; } diff --git a/angular/src/components/send/send.component.ts b/angular/src/components/send/send.component.ts index 6ece39be..77f36459 100644 --- a/angular/src/components/send/send.component.ts +++ b/angular/src/components/send/send.component.ts @@ -4,7 +4,6 @@ import { OnInit, } from '@angular/core'; -import { OrganizationUserStatusType } from 'jslib-common/enums/organizationUserStatusType'; import { PolicyType } from 'jslib-common/enums/policyType'; import { SendType } from 'jslib-common/enums/sendType'; @@ -12,6 +11,7 @@ import { SendView } from 'jslib-common/models/view/sendView'; import { EnvironmentService } from 'jslib-common/abstractions/environment.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { PolicyService } from 'jslib-common/abstractions/policy.service'; import { SearchService } from 'jslib-common/abstractions/search.service'; @@ -48,7 +48,8 @@ export class SendComponent implements OnInit { constructor(protected sendService: SendService, protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService, protected environmentService: EnvironmentService, protected ngZone: NgZone, protected searchService: SearchService, - protected policyService: PolicyService, protected userService: UserService) { } + protected policyService: PolicyService, protected userService: UserService, + private logService: LogService) { } async ngOnInit() { this.disableSend = await this.policyService.policyAppliesToUser(PolicyType.DisableSend); @@ -129,7 +130,9 @@ export class SendComponent implements OnInit { this.platformUtilsService.showToast('success', null, this.i18nService.t('removedPassword')); await this.load(); } - } catch { } + } catch (e) { + this.logService.error(e); + } this.actionPromise = null; } @@ -156,7 +159,9 @@ export class SendComponent implements OnInit { this.platformUtilsService.showToast('success', null, this.i18nService.t('deletedSend')); await this.refresh(); } - } catch { } + } catch (e) { + this.logService.error(e); + } this.actionPromise = null; return true; } diff --git a/angular/src/components/share.component.ts b/angular/src/components/share.component.ts index d06c3aa7..e5badc37 100644 --- a/angular/src/components/share.component.ts +++ b/angular/src/components/share.component.ts @@ -11,6 +11,7 @@ import { OrganizationUserStatusType } from 'jslib-common/enums/organizationUserS import { CipherService } from 'jslib-common/abstractions/cipher.service'; import { CollectionService } from 'jslib-common/abstractions/collection.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { UserService } from 'jslib-common/abstractions/user.service'; @@ -35,7 +36,7 @@ export class ShareComponent implements OnInit { constructor(protected collectionService: CollectionService, protected platformUtilsService: PlatformUtilsService, protected i18nService: I18nService, protected userService: UserService, - protected cipherService: CipherService) { } + protected cipherService: CipherService, private logService: LogService) { } async ngOnInit() { await this.load(); @@ -88,7 +89,9 @@ export class ShareComponent implements OnInit { }); await this.formPromise; return true; - } catch { } + } catch (e) { + this.logService.error(e); + } return false; } diff --git a/angular/src/components/sso.component.ts b/angular/src/components/sso.component.ts index 6f55641c..3a5272a4 100644 --- a/angular/src/components/sso.component.ts +++ b/angular/src/components/sso.component.ts @@ -11,6 +11,7 @@ import { AuthService } from 'jslib-common/abstractions/auth.service'; import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service'; import { EnvironmentService } from 'jslib-common/abstractions/environment.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { StateService } from 'jslib-common/abstractions/state.service'; @@ -49,7 +50,7 @@ export class SsoComponent { protected storageService: StorageService, protected stateService: StateService, protected platformUtilsService: PlatformUtilsService, protected apiService: ApiService, protected cryptoFunctionService: CryptoFunctionService, protected environmentService: EnvironmentService, - protected passwordGenerationService: PasswordGenerationService) { } + protected passwordGenerationService: PasswordGenerationService, protected logService: LogService) { } async ngOnInit() { this.route.queryParams.pipe(first()).subscribe(async qParams => { @@ -180,7 +181,9 @@ export class SsoComponent { this.router.navigate([this.successRoute]); } } - } catch { } + } catch (e) { + this.logService.error(e); + } this.loggingIn = false; } diff --git a/angular/src/components/two-factor.component.ts b/angular/src/components/two-factor.component.ts index 97120d2f..18deda6e 100644 --- a/angular/src/components/two-factor.component.ts +++ b/angular/src/components/two-factor.component.ts @@ -17,6 +17,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service'; import { AuthService } from 'jslib-common/abstractions/auth.service'; import { EnvironmentService } from 'jslib-common/abstractions/environment.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { StateService } from 'jslib-common/abstractions/state.service'; import { StorageService } from 'jslib-common/abstractions/storage.service'; @@ -57,7 +58,8 @@ export class TwoFactorComponent implements OnInit, OnDestroy { protected i18nService: I18nService, protected apiService: ApiService, protected platformUtilsService: PlatformUtilsService, protected win: Window, protected environmentService: EnvironmentService, protected stateService: StateService, - protected storageService: StorageService, protected route: ActivatedRoute) { + protected storageService: StorageService, protected route: ActivatedRoute, + protected logService: LogService) { this.webAuthnSupported = this.platformUtilsService.supportsWebAuthn(win); } @@ -216,7 +218,9 @@ export class TwoFactorComponent implements OnInit, OnDestroy { this.platformUtilsService.showToast('success', null, this.i18nService.t('verificationCodeEmailSent', this.twoFactorEmail)); } - } catch { } + } catch (e) { + this.logService.error(e); + } this.emailPromise = null; } diff --git a/angular/src/components/update-temp-password.component.ts b/angular/src/components/update-temp-password.component.ts index 13875631..29e54521 100644 --- a/angular/src/components/update-temp-password.component.ts +++ b/angular/src/components/update-temp-password.component.ts @@ -3,6 +3,7 @@ import { Directive } from '@angular/core'; import { ApiService } from 'jslib-common/abstractions/api.service'; import { CryptoService } from 'jslib-common/abstractions/crypto.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { MessagingService } from 'jslib-common/abstractions/messaging.service'; import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; @@ -31,7 +32,7 @@ export class UpdateTempPasswordComponent extends BaseChangePasswordComponent { passwordGenerationService: PasswordGenerationService, policyService: PolicyService, cryptoService: CryptoService, userService: UserService, messagingService: MessagingService, private apiService: ApiService, - private syncService: SyncService) { + private syncService: SyncService, private logService: LogService) { super(i18nService, cryptoService, messagingService, userService, passwordGenerationService, platformUtilsService, policyService); } @@ -77,7 +78,9 @@ export class UpdateTempPasswordComponent extends BaseChangePasswordComponent { const newEncKey = await this.cryptoService.remakeEncKey(newKey, userEncKey); await this.performSubmitActions(newPasswordHash, newKey, newEncKey); - } catch { } + } catch (e) { + this.logService.error(e); + } } async performSubmitActions(masterPasswordHash: string, key: SymmetricCryptoKey, @@ -99,6 +102,8 @@ export class UpdateTempPasswordComponent extends BaseChangePasswordComponent { } else { this.messagingService.send('logout'); } - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/angular/src/components/view.component.ts b/angular/src/components/view.component.ts index 2923446f..8e12634f 100644 --- a/angular/src/components/view.component.ts +++ b/angular/src/components/view.component.ts @@ -21,6 +21,7 @@ import { CipherService } from 'jslib-common/abstractions/cipher.service'; import { CryptoService } from 'jslib-common/abstractions/crypto.service'; import { EventService } from 'jslib-common/abstractions/event.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PasswordRepromptService } from 'jslib-common/abstractions/passwordReprompt.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { TokenService } from 'jslib-common/abstractions/token.service'; @@ -31,7 +32,6 @@ import { ErrorResponse } from 'jslib-common/models/response/errorResponse'; import { AttachmentView } from 'jslib-common/models/view/attachmentView'; import { CipherView } from 'jslib-common/models/view/cipherView'; -import { FieldView } from 'jslib-common/models/view/fieldView'; import { LoginUriView } from 'jslib-common/models/view/loginUriView'; const BroadcasterSubscriptionId = 'ViewComponent'; @@ -69,7 +69,7 @@ export class ViewComponent implements OnDestroy, OnInit { protected broadcasterService: BroadcasterService, protected ngZone: NgZone, protected changeDetectorRef: ChangeDetectorRef, protected userService: UserService, protected eventService: EventService, protected apiService: ApiService, - protected passwordRepromptService: PasswordRepromptService) { } + protected passwordRepromptService: PasswordRepromptService, private logService: LogService) { } ngOnInit() { this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => { @@ -159,7 +159,9 @@ export class ViewComponent implements OnDestroy, OnInit { this.platformUtilsService.showToast('success', null, this.i18nService.t(this.cipher.isDeleted ? 'permanentlyDeletedItem' : 'deletedItem')); this.onDeletedCipher.emit(this.cipher); - } catch { } + } catch (e) { + this.logService.error(e); + } return true; } @@ -180,7 +182,9 @@ export class ViewComponent implements OnDestroy, OnInit { await this.restoreCipher(); this.platformUtilsService.showToast('success', null, this.i18nService.t('restoredItem')); this.onRestoredCipher.emit(this.cipher); - } catch { } + } catch (e) { + this.logService.error(e); + } return true; } diff --git a/common/src/importers/passpackCsvImporter.ts b/common/src/importers/passpackCsvImporter.ts index d2450b90..ba51490f 100644 --- a/common/src/importers/passpackCsvImporter.ts +++ b/common/src/importers/passpackCsvImporter.ts @@ -21,7 +21,9 @@ export class PasspackCsvImporter extends BaseImporter implements Importer { try { const t = JSON.parse(tagJson); return this.getValueOrDefault(t.tag); - } catch { } + } catch { + // Ignore error + } return null; }).filter((t: string) => !this.isNullOrWhitespace(t)) : null; @@ -72,7 +74,9 @@ export class PasspackCsvImporter extends BaseImporter implements Importer { fieldsJson.extraFields.length > 0 ? fieldsJson.extraFields.map((fieldJson: string) => { try { return JSON.parse(fieldJson); - } catch { } + } catch { + // Ignore error + } return null; }) : null; if (fields != null) { diff --git a/common/src/importers/passwordBossJsonImporter.ts b/common/src/importers/passwordBossJsonImporter.ts index 3edb18ed..88a70ee6 100644 --- a/common/src/importers/passwordBossJsonImporter.ts +++ b/common/src/importers/passwordBossJsonImporter.ts @@ -84,7 +84,9 @@ export class PasswordBossJsonImporter extends BaseImporter implements Importer { const expDate = new Date(val); cipher.card.expYear = expDate.getFullYear().toString(); cipher.card.expMonth = (expDate.getMonth() + 1).toString(); - } catch { } + } catch { + // Ignore error + } continue; } else if (property === 'cardType') { continue; diff --git a/common/src/importers/rememBearCsvImporter.ts b/common/src/importers/rememBearCsvImporter.ts index c12788b7..2388ea0f 100644 --- a/common/src/importers/rememBearCsvImporter.ts +++ b/common/src/importers/rememBearCsvImporter.ts @@ -43,7 +43,9 @@ export class RememBearCsvImporter extends BaseImporter implements Importer { cipher.card.expMonth = expMonthNumber.toString(); } } - } catch { } + } catch { + // Ignore error + } try { const expYear = this.getValueOrDefault(value.expiryYear); if (expYear != null) { @@ -52,7 +54,9 @@ export class RememBearCsvImporter extends BaseImporter implements Importer { cipher.card.expYear = expYearNumber.toString(); } } - } catch { } + } catch { + // Ignore error + } const pin = this.getValueOrDefault(value.pin); if (pin != null) { diff --git a/common/src/importers/truekeyCsvImporter.ts b/common/src/importers/truekeyCsvImporter.ts index 52f43da8..aa004b67 100644 --- a/common/src/importers/truekeyCsvImporter.ts +++ b/common/src/importers/truekeyCsvImporter.ts @@ -47,7 +47,9 @@ export class TrueKeyCsvImporter extends BaseImporter implements Importer { const expDate = new Date(value.expiryDate); cipher.card.expYear = expDate.getFullYear().toString(); cipher.card.expMonth = (expDate.getMonth() + 1).toString(); - } catch { } + } catch { + // Ignore error + } } } else if (value.kind !== 'login') { cipher.type = CipherType.SecureNote; diff --git a/common/src/misc/utils.ts b/common/src/misc/utils.ts index a6921c92..55c4388e 100644 --- a/common/src/misc/utils.ts +++ b/common/src/misc/utils.ts @@ -238,7 +238,9 @@ export class Utils { const urlDomain = tldjs != null && tldjs.getDomain != null ? tldjs.getDomain(url.hostname) : null; return urlDomain != null ? urlDomain : url.hostname; - } catch (e) { } + } catch (e) { + // Invalid domain, try another approach below. + } } try { @@ -367,7 +369,9 @@ export class Utils { anchor.href = uriString; return anchor as any; } - } catch (e) { } + } catch (e) { + // Ignore error + } return null; } diff --git a/common/src/models/view/attachmentView.ts b/common/src/models/view/attachmentView.ts index 65c896ea..45c04f48 100644 --- a/common/src/models/view/attachmentView.ts +++ b/common/src/models/view/attachmentView.ts @@ -27,7 +27,9 @@ export class AttachmentView implements View { if (this.size != null) { return parseInt(this.size, null); } - } catch { } + } catch { + // Invalid file size. + } return 0; } } diff --git a/common/src/models/view/sendFileView.ts b/common/src/models/view/sendFileView.ts index 97192607..a58df8f3 100644 --- a/common/src/models/view/sendFileView.ts +++ b/common/src/models/view/sendFileView.ts @@ -23,7 +23,9 @@ export class SendFileView implements View { if (this.size != null) { return parseInt(this.size, null); } - } catch { } + } catch { + // Invalid file size. + } return 0; } } diff --git a/common/src/services/azureFileUpload.service.ts b/common/src/services/azureFileUpload.service.ts index d188d9b6..680e5ffc 100644 --- a/common/src/services/azureFileUpload.service.ts +++ b/common/src/services/azureFileUpload.service.ts @@ -185,7 +185,9 @@ class Version { this.year = parts[0]; this.month = parts[1]; this.day = parts[2]; - } catch { } + } catch { + // Ignore error + } } /** * Compares two Azure Versions against each other diff --git a/common/src/services/cipher.service.ts b/common/src/services/cipher.service.ts index f5ac5449..bd6ab018 100644 --- a/common/src/services/cipher.service.ts +++ b/common/src/services/cipher.service.ts @@ -51,6 +51,7 @@ import { UserService } from '../abstractions/user.service'; import { ConstantsService } from './constants.service'; +import { LogService } from '../abstractions/log.service'; import { sequentialize } from '../misc/sequentialize'; import { Utils } from '../misc/utils'; @@ -73,7 +74,8 @@ export class CipherService implements CipherServiceAbstraction { constructor(private cryptoService: CryptoService, private userService: UserService, private settingsService: SettingsService, private apiService: ApiService, private fileUploadService: FileUploadService, private storageService: StorageService, - private i18nService: I18nService, private searchService: () => SearchService) { + private i18nService: I18nService, private searchService: () => SearchService, + private logService: LogService) { } get decryptedCipherCache() { @@ -423,7 +425,9 @@ export class CipherService implements CipherServiceAbstraction { if (regex.test(url)) { return true; } - } catch { } + } catch (e) { + this.logService.error(e); + } break; case UriMatchType.Never: default: diff --git a/common/src/services/crypto.service.ts b/common/src/services/crypto.service.ts index dd4d73ca..60ef0ea0 100644 --- a/common/src/services/crypto.service.ts +++ b/common/src/services/crypto.service.ts @@ -564,7 +564,9 @@ export class CryptoService implements CryptoServiceAbstraction { try { encType = parseInt(headerPieces[0], null); encPieces = headerPieces[1].split('|'); - } catch (e) { } + } catch (e) { + this.logService.error(e); + } } switch (encType) { diff --git a/common/src/services/event.service.ts b/common/src/services/event.service.ts index b34cd4b6..452133fa 100644 --- a/common/src/services/event.service.ts +++ b/common/src/services/event.service.ts @@ -10,13 +10,15 @@ import { EventService as EventServiceAbstraction } from '../abstractions/event.s import { StorageService } from '../abstractions/storage.service'; import { UserService } from '../abstractions/user.service'; +import { LogService } from '../abstractions/log.service'; import { ConstantsService } from './constants.service'; export class EventService implements EventServiceAbstraction { private inited = false; constructor(private storageService: StorageService, private apiService: ApiService, - private userService: UserService, private cipherService: CipherService) { } + private userService: UserService, private cipherService: CipherService, + private logService: LogService) { } init(checkOnInterval: boolean) { if (this.inited) { @@ -83,7 +85,9 @@ export class EventService implements EventServiceAbstraction { try { await this.apiService.postEventsCollect(request); this.clearEvents(); - } catch { } + } catch (e) { + this.logService.error(e); + } } async clearEvents(): Promise { diff --git a/common/src/services/notifications.service.ts b/common/src/services/notifications.service.ts index 63f66b8b..b1d5723b 100644 --- a/common/src/services/notifications.service.ts +++ b/common/src/services/notifications.service.ts @@ -192,7 +192,9 @@ export class NotificationsService implements NotificationsServiceAbstraction { if (sync) { await this.syncService.fullSync(false); } - } catch { } + } catch (e) { + this.logService.error(e); + } if (!this.connected) { this.reconnectTimer = setTimeout(() => this.reconnect(sync), this.random(120000, 300000)); diff --git a/common/src/services/search.service.ts b/common/src/services/search.service.ts index 454ee290..91eb2b6b 100644 --- a/common/src/services/search.service.ts +++ b/common/src/services/search.service.ts @@ -125,7 +125,9 @@ export class SearchService implements SearchServiceAbstraction { if (isQueryString) { try { searchResults = index.search(query.substr(1).trim()); - } catch { } + } catch (e) { + this.logService.error(e); + } } else { // tslint:disable-next-line const soWild = lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING; diff --git a/common/src/services/sync.service.ts b/common/src/services/sync.service.ts index 9484929c..219a5765 100644 --- a/common/src/services/sync.service.ts +++ b/common/src/services/sync.service.ts @@ -3,6 +3,7 @@ import { CipherService } from '../abstractions/cipher.service'; import { CollectionService } from '../abstractions/collection.service'; import { CryptoService } from '../abstractions/crypto.service'; import { FolderService } from '../abstractions/folder.service'; +import { LogService } from '../abstractions/log.service'; import { MessagingService } from '../abstractions/messaging.service'; import { PolicyService } from '../abstractions/policy.service'; import { SendService } from '../abstractions/send.service'; @@ -44,7 +45,8 @@ export class SyncService implements SyncServiceAbstraction { private cipherService: CipherService, private cryptoService: CryptoService, private collectionService: CollectionService, private storageService: StorageService, private messagingService: MessagingService, private policyService: PolicyService, - private sendService: SendService, private logoutCallback: (expired: boolean) => Promise) { + private sendService: SendService, private logService: LogService, + private logoutCallback: (expired: boolean) => Promise) { } async getLastSync(): Promise { @@ -131,7 +133,9 @@ export class SyncService implements SyncServiceAbstraction { return this.syncCompleted(true); } } - } catch { } + } catch (e) { + this.logService.error(e); + } } return this.syncCompleted(false); } @@ -230,7 +234,9 @@ export class SyncService implements SyncServiceAbstraction { return this.syncCompleted(true); } } - } catch { } + } catch (e) { + this.logService.error(e); + } } return this.syncCompleted(false); } diff --git a/common/src/services/totp.service.ts b/common/src/services/totp.service.ts index aa4f8dd1..50c8c4eb 100644 --- a/common/src/services/totp.service.ts +++ b/common/src/services/totp.service.ts @@ -1,6 +1,7 @@ import { ConstantsService } from './constants.service'; import { CryptoFunctionService } from '../abstractions/cryptoFunction.service'; +import { LogService } from '../abstractions/log.service'; import { StorageService } from '../abstractions/storage.service'; import { TotpService as TotpServiceAbstraction } from '../abstractions/totp.service'; @@ -10,7 +11,8 @@ const B32Chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'; const SteamChars = '23456789BCDFGHJKMNPQRTVWXY'; export class TotpService implements TotpServiceAbstraction { - constructor(private storageService: StorageService, private cryptoFunctionService: CryptoFunctionService) { } + constructor(private storageService: StorageService, private cryptoFunctionService: CryptoFunctionService, + private logService: LogService) { } async getCode(key: string): Promise { if (key == null) { @@ -32,7 +34,9 @@ export class TotpService implements TotpServiceAbstraction { } else if (digitParams > 0) { digits = digitParams; } - } catch { } + } catch { + this.logService.error('Invalid digits param.'); + } } if (params.has('period') && params.get('period') != null) { try { @@ -40,7 +44,9 @@ export class TotpService implements TotpServiceAbstraction { if (periodParam > 0) { period = periodParam; } - } catch { } + } catch { + this.logService.error('Invalid period param.'); + } } if (params.has('secret') && params.get('secret') != null) { keyB32 = params.get('secret'); @@ -99,7 +105,9 @@ export class TotpService implements TotpServiceAbstraction { if (params.has('period') && params.get('period') != null) { try { period = parseInt(params.get('period').trim(), null); - } catch { } + } catch { + this.logService.error('Invalid period param.'); + } } } return period; diff --git a/electron/src/biometric.windows.main.ts b/electron/src/biometric.windows.main.ts index 5ec7cb64..d33875b7 100644 --- a/electron/src/biometric.windows.main.ts +++ b/electron/src/biometric.windows.main.ts @@ -6,6 +6,7 @@ import { WindowMain } from './window.main'; import { BiometricMain } from 'jslib-common/abstractions/biometric.main'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { StorageService } from 'jslib-common/abstractions/storage.service'; import { ConstantsService } from 'jslib-common/services/constants.service'; @@ -14,7 +15,8 @@ export default class BiometricWindowsMain implements BiometricMain { private windowsSecurityCredentialsUiModule: any; - constructor(private storageService: StorageService, private i18nservice: I18nService, private windowMain: WindowMain) { } + constructor(private storageService: StorageService, private i18nservice: I18nService, private windowMain: WindowMain, + private logService: LogService) { } async init() { this.windowsSecurityCredentialsUiModule = this.getWindowsSecurityCredentialsUiModule(); @@ -125,8 +127,9 @@ export default class BiometricWindowsMain implements BiometricMain { try { const version = require('os').release(); return Number.parseInt(version.split('.')[0], 10); + } catch { + this.logService.error('Unable to resolve windows major version number'); } - catch { } return -1; } } diff --git a/electron/src/window.main.ts b/electron/src/window.main.ts index 26499c7d..28b3ca0a 100644 --- a/electron/src/window.main.ts +++ b/electron/src/window.main.ts @@ -1,13 +1,21 @@ -import { app, BrowserWindow, screen } from 'electron'; -import { ElectronConstants } from './electronConstants'; - +import { + app, + BrowserWindow, + screen, +} from 'electron'; import * as path from 'path'; import * as url from 'url'; -import { isDev, isMacAppStore, isSnapStore } from './utils'; - +import { LogService } from 'jslib-common/abstractions/log.service'; import { StorageService } from 'jslib-common/abstractions/storage.service'; +import { ElectronConstants } from './electronConstants'; +import { + isDev, + isMacAppStore, + isSnapStore, +} from './utils'; + const WindowEventHandlingDelay = 100; const Keys = { mainWindowSize: 'mainWindowSize', @@ -21,8 +29,8 @@ export class WindowMain { private windowStates: { [key: string]: any; } = {}; private enableAlwaysOnTop: boolean = false; - constructor(private storageService: StorageService, private hideTitleBar = false, - private defaultWidth = 950, private defaultHeight = 600, + constructor(private storageService: StorageService, private logService: LogService, + private hideTitleBar = false, private defaultWidth = 950, private defaultHeight = 600, private argvCallback: (argv: string[]) => void = null, private createWindowCallback: (win: BrowserWindow) => void) { } @@ -224,7 +232,9 @@ export class WindowMain { } await this.storageService.save(configKey, this.windowStates[configKey]); - } catch (e) { } + } catch (e) { + this.logService.error(e); + } } private async getWindowState(configKey: string, defaultWidth: number, defaultHeight: number) { diff --git a/node/src/cli/commands/login.command.ts b/node/src/cli/commands/login.command.ts index 7abf91ac..33b19eb1 100644 --- a/node/src/cli/commands/login.command.ts +++ b/node/src/cli/commands/login.command.ts @@ -468,7 +468,9 @@ export class LoginCommand { }); foundPort = true; break; - } catch { } + } catch { + // Ignore error since we run the same command up to 5 times. + } } if (!foundPort) { reject(); diff --git a/spec/common/services/cipher.service.spec.ts b/spec/common/services/cipher.service.spec.ts index 17f3164d..83dce24c 100644 --- a/spec/common/services/cipher.service.spec.ts +++ b/spec/common/services/cipher.service.spec.ts @@ -4,6 +4,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service'; import { CryptoService } from 'jslib-common/abstractions/crypto.service'; import { FileUploadService } from 'jslib-common/abstractions/fileUpload.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { SearchService } from 'jslib-common/abstractions/search.service'; import { SettingsService } from 'jslib-common/abstractions/settings.service'; import { StorageService } from 'jslib-common/abstractions/storage.service'; @@ -28,6 +29,7 @@ describe('Cipher Service', () => { let storageService: SubstituteOf; let i18nService: SubstituteOf; let searchService: SubstituteOf; + let logService: SubstituteOf; let cipherService: CipherService; @@ -40,12 +42,13 @@ describe('Cipher Service', () => { storageService = Substitute.for(); i18nService = Substitute.for(); searchService = Substitute.for(); + logService = Substitute.for(); cryptoService.encryptToBytes(Arg.any(), Arg.any()).resolves(ENCRYPTED_BYTES); cryptoService.encrypt(Arg.any(), Arg.any()).resolves(new EncString(ENCRYPTED_TEXT)); cipherService = new CipherService(cryptoService, userService, settingsService, apiService, fileUploadService, - storageService, i18nService, () => searchService); + storageService, i18nService, () => searchService, logService); }); it('attachments upload encrypted file contents', async () => { diff --git a/tslint.json b/tslint.json index d0c32a36..ff350764 100644 --- a/tslint.json +++ b/tslint.json @@ -35,7 +35,7 @@ ] } ], - "no-empty": [ true, "allow-empty-catch" ], + "no-empty": [ true ], "object-literal-sort-keys": false, "object-literal-shorthand": [ true, "never" ], "ordered-imports": true,