diff --git a/bitwarden_license/src/app/providers/manage/user-add-edit.component.ts b/bitwarden_license/src/app/providers/manage/user-add-edit.component.ts index e70ffd16..8fdcd47b 100644 --- a/bitwarden_license/src/app/providers/manage/user-add-edit.component.ts +++ b/bitwarden_license/src/app/providers/manage/user-add-edit.component.ts @@ -10,6 +10,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { ProviderUserInviteRequest } from 'jslib-common/models/request/provider/providerUserInviteRequest'; @@ -43,7 +44,8 @@ export class UserAddEditComponent implements OnInit { userType = ProviderUserType; constructor(private apiService: ApiService, private i18nService: I18nService, - private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService) { } + private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService, + private logService: LogService) { } async ngOnInit() { this.editMode = this.loading = this.providerUserId != null; @@ -54,7 +56,9 @@ export class UserAddEditComponent implements OnInit { try { const user = await this.apiService.getProviderUser(this.providerId, this.providerUserId); this.type = user.type; - } catch { } + } catch (e) { + this.logService.error(e); + } } else { this.title = this.i18nService.t('inviteUser'); } @@ -78,7 +82,9 @@ export class UserAddEditComponent implements OnInit { this.toasterService.popAsync('success', null, this.i18nService.t(this.editMode ? 'editedUserId' : 'invitedUsers', this.name)); this.onSavedUser.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } async delete() { @@ -98,7 +104,9 @@ export class UserAddEditComponent implements OnInit { await this.deletePromise; this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', this.name)); this.onDeletedUser.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/jslib b/jslib index a20e9352..f09fb698 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit a20e935268c986538ff68f72016bb8c772ea3a1b +Subproject commit f09fb69882525b3be7b2e257e7723eeb79b343d1 diff --git a/src/app/accounts/accept-organization.component.ts b/src/app/accounts/accept-organization.component.ts index 9f1759fe..267ce840 100644 --- a/src/app/accounts/accept-organization.component.ts +++ b/src/app/accounts/accept-organization.component.ts @@ -12,6 +12,7 @@ import { 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 { PolicyService } from 'jslib-common/abstractions/policy.service'; import { StateService } from 'jslib-common/abstractions/state.service'; import { UserService } from 'jslib-common/abstractions/user.service'; @@ -36,7 +37,7 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent { i18nService: I18nService, route: ActivatedRoute, private apiService: ApiService, userService: UserService, stateService: StateService, private cryptoService: CryptoService, - private policyService: PolicyService) { + private policyService: PolicyService, private logService: LogService) { super(router, toasterService, i18nService, route, userService, stateService); } @@ -101,7 +102,9 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent { const policies = await this.apiService.getPoliciesByToken(qParams.organizationId, qParams.token, qParams.email, qParams.organizationUserId); policyList = this.policyService.mapPoliciesFromToken(policies); - } catch { } + } catch (e) { + this.logService.error(e); + } if (policyList != null) { const result = this.policyService.getResetPasswordPolicyOptions(policyList, qParams.organizationId); diff --git a/src/app/accounts/hint.component.ts b/src/app/accounts/hint.component.ts index e65f9f5d..beb6b0d5 100644 --- a/src/app/accounts/hint.component.ts +++ b/src/app/accounts/hint.component.ts @@ -3,6 +3,7 @@ import { Router } from '@angular/router'; 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 { HintComponent as BaseHintComponent } from 'jslib-angular/components/hint.component'; @@ -13,7 +14,8 @@ import { HintComponent as BaseHintComponent } from 'jslib-angular/components/hin }) export class HintComponent extends BaseHintComponent { constructor(router: Router, i18nService: I18nService, - apiService: ApiService, platformUtilsService: PlatformUtilsService) { - super(router, i18nService, apiService, platformUtilsService); + apiService: ApiService, platformUtilsService: PlatformUtilsService, + logService: LogService) { + super(router, i18nService, apiService, platformUtilsService, logService); } } diff --git a/src/app/accounts/lock.component.ts b/src/app/accounts/lock.component.ts index 8145079c..5ce77d9f 100644 --- a/src/app/accounts/lock.component.ts +++ b/src/app/accounts/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'; @@ -26,9 +27,9 @@ export class LockComponent extends BaseLockComponent { userService: UserService, cryptoService: CryptoService, storageService: StorageService, vaultTimeoutService: VaultTimeoutService, environmentService: EnvironmentService, private routerService: RouterService, - stateService: StateService, apiService: ApiService) { + stateService: StateService, apiService: ApiService, logService: LogService) { super(router, i18nService, platformUtilsService, messagingService, userService, cryptoService, - storageService, vaultTimeoutService, environmentService, stateService, apiService); + storageService, vaultTimeoutService, environmentService, stateService, apiService, logService); } async ngOnInit() { diff --git a/src/app/accounts/login.component.ts b/src/app/accounts/login.component.ts index d2c0da1f..00cbc485 100644 --- a/src/app/accounts/login.component.ts +++ b/src/app/accounts/login.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 { PolicyService } from 'jslib-common/abstractions/policy.service'; @@ -34,12 +35,12 @@ export class LoginComponent extends BaseLoginComponent { storageService: StorageService, stateService: StateService, platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService, passwordGenerationService: PasswordGenerationService, cryptoFunctionService: CryptoFunctionService, - private apiService: ApiService, private policyService: PolicyService) { + private apiService: ApiService, private policyService: PolicyService, logService: LogService) { super(authService, router, platformUtilsService, i18nService, stateService, environmentService, passwordGenerationService, cryptoFunctionService, - storageService); + storageService, logService); this.onSuccessfulLoginNavigate = this.goAfterLogIn; } @@ -64,7 +65,9 @@ export class LoginComponent extends BaseLoginComponent { const policies = await this.apiService.getPoliciesByToken(invite.organizationId, invite.token, invite.email, invite.organizationUserId); policyList = this.policyService.mapPoliciesFromToken(policies); - } catch { } + } catch (e) { + this.logService.error(e); + } if (policyList != null) { const result = this.policyService.getResetPasswordPolicyOptions(policyList, invite.organizationId); diff --git a/src/app/accounts/recover-delete.component.ts b/src/app/accounts/recover-delete.component.ts index 1024e3fe..aaf53cb7 100644 --- a/src/app/accounts/recover-delete.component.ts +++ b/src/app/accounts/recover-delete.component.ts @@ -5,6 +5,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { DeleteRecoverRequest } from 'jslib-common/models/request/deleteRecoverRequest'; @@ -17,7 +18,8 @@ export class RecoverDeleteComponent { formPromise: Promise; constructor(private router: Router, private apiService: ApiService, - private toasterService: ToasterService, private i18nService: I18nService) { + private toasterService: ToasterService, private i18nService: I18nService, + private logService: LogService) { } async submit() { @@ -28,6 +30,8 @@ export class RecoverDeleteComponent { await this.formPromise; this.toasterService.popAsync('success', null, this.i18nService.t('deleteRecoverEmailSent')); this.router.navigate(['/']); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/accounts/recover-two-factor.component.ts b/src/app/accounts/recover-two-factor.component.ts index 21dc7125..4d7263d1 100644 --- a/src/app/accounts/recover-two-factor.component.ts +++ b/src/app/accounts/recover-two-factor.component.ts @@ -7,6 +7,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service'; import { AuthService } from 'jslib-common/abstractions/auth.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 { TwoFactorRecoveryRequest } from 'jslib-common/models/request/twoFactorRecoveryRequest'; @@ -22,7 +23,8 @@ export class RecoverTwoFactorComponent { constructor(private router: Router, private apiService: ApiService, private toasterService: ToasterService, private i18nService: I18nService, - private cryptoService: CryptoService, private authService: AuthService) { } + private cryptoService: CryptoService, private authService: AuthService, + private logService: LogService) { } async submit() { try { @@ -35,6 +37,8 @@ export class RecoverTwoFactorComponent { await this.formPromise; this.toasterService.popAsync('success', null, this.i18nService.t('twoStepRecoverDisabled')); this.router.navigate(['/']); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/accounts/register.component.ts b/src/app/accounts/register.component.ts index 3fd9b6bc..98eae878 100644 --- a/src/app/accounts/register.component.ts +++ b/src/app/accounts/register.component.ts @@ -11,6 +11,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 { PolicyService } from 'jslib-common/abstractions/policy.service'; @@ -40,9 +41,9 @@ export class RegisterComponent extends BaseRegisterComponent { apiService: ApiService, private route: ActivatedRoute, stateService: StateService, platformUtilsService: PlatformUtilsService, passwordGenerationService: PasswordGenerationService, private policyService: PolicyService, - environmentService: EnvironmentService) { + environmentService: EnvironmentService, logService: LogService) { super(authService, router, i18nService, cryptoService, apiService, stateService, platformUtilsService, - passwordGenerationService, environmentService); + passwordGenerationService, environmentService, logService); } async ngOnInit() { @@ -80,7 +81,9 @@ export class RegisterComponent extends BaseRegisterComponent { const policiesData = policies.data.map(p => new PolicyData(p)); this.policies = policiesData.map(p => new Policy(p)); } - } catch { } + } catch (e) { + this.logService.error(e); + } } if (this.policies != null) { diff --git a/src/app/accounts/sso.component.ts b/src/app/accounts/sso.component.ts index cedfdad1..76914ea2 100644 --- a/src/app/accounts/sso.component.ts +++ b/src/app/accounts/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'; @@ -30,9 +31,9 @@ export class SsoComponent extends BaseSsoComponent { storageService: StorageService, stateService: StateService, platformUtilsService: PlatformUtilsService, apiService: ApiService, cryptoFunctionService: CryptoFunctionService, environmentService: EnvironmentService, - passwordGenerationService: PasswordGenerationService) { + passwordGenerationService: PasswordGenerationService, logService: LogService) { super(authService, router, i18nService, route, storageService, stateService, platformUtilsService, - apiService, cryptoFunctionService, environmentService, passwordGenerationService); + apiService, cryptoFunctionService, environmentService, passwordGenerationService, logService); this.redirectUri = window.location.origin + '/sso-connector.html'; this.clientId = 'web'; } diff --git a/src/app/accounts/two-factor.component.ts b/src/app/accounts/two-factor.component.ts index fefd5af1..75363b3d 100644 --- a/src/app/accounts/two-factor.component.ts +++ b/src/app/accounts/two-factor.component.ts @@ -23,6 +23,7 @@ import { TwoFactorProviderType } from 'jslib-common/enums/twoFactorProviderType' import { TwoFactorComponent as BaseTwoFactorComponent } from 'jslib-angular/components/two-factor.component'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { TwoFactorOptionsComponent } from './two-factor-options.component'; @Component({ @@ -36,9 +37,9 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { i18nService: I18nService, apiService: ApiService, platformUtilsService: PlatformUtilsService, stateService: StateService, environmentService: EnvironmentService, private modalService: ModalService, - storageService: StorageService, route: ActivatedRoute) { + storageService: StorageService, route: ActivatedRoute, logService: LogService) { super(authService, router, i18nService, apiService, platformUtilsService, window, environmentService, - stateService, storageService, route); + stateService, storageService, route, logService); this.onSuccessfulLoginNavigate = this.goAfterLogIn; } diff --git a/src/app/accounts/update-temp-password.component.ts b/src/app/accounts/update-temp-password.component.ts index 10329c8e..f1767ffd 100644 --- a/src/app/accounts/update-temp-password.component.ts +++ b/src/app/accounts/update-temp-password.component.ts @@ -3,6 +3,7 @@ import { Component } 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'; @@ -22,8 +23,8 @@ export class UpdateTempPasswordComponent extends BaseUpdateTempPasswordComponent passwordGenerationService: PasswordGenerationService, policyService: PolicyService, cryptoService: CryptoService, userService: UserService, messagingService: MessagingService, apiService: ApiService, - syncService: SyncService) { + syncService: SyncService, logService: LogService) { super(i18nService, platformUtilsService, passwordGenerationService, policyService, cryptoService, - userService, messagingService, apiService, syncService); + userService, messagingService, apiService, syncService, logService); } } diff --git a/src/app/accounts/verify-email-token.component.ts b/src/app/accounts/verify-email-token.component.ts index f21fa856..aac7bac7 100644 --- a/src/app/accounts/verify-email-token.component.ts +++ b/src/app/accounts/verify-email-token.component.ts @@ -13,6 +13,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { UserService } from 'jslib-common/abstractions/user.service'; import { VerifyEmailRequest } from 'jslib-common/models/request/verifyEmailRequest'; @@ -24,7 +25,8 @@ import { VerifyEmailRequest } from 'jslib-common/models/request/verifyEmailReque export class VerifyEmailTokenComponent implements OnInit { constructor(private router: Router, private toasterService: ToasterService, private i18nService: I18nService, private route: ActivatedRoute, - private apiService: ApiService, private userService: UserService) { } + private apiService: ApiService, private userService: UserService, + private logService: LogService) { } ngOnInit() { this.route.queryParams.pipe(first()).subscribe(async qParams => { @@ -39,7 +41,9 @@ export class VerifyEmailTokenComponent implements OnInit { this.toasterService.popAsync('success', null, this.i18nService.t('emailVerified')); this.router.navigate(['/']); return; - } catch { } + } catch (e) { + this.logService.error(e); + } } this.toasterService.popAsync('error', null, this.i18nService.t('emailVerifiedFailed')); this.router.navigate(['/']); diff --git a/src/app/accounts/verify-recover-delete.component.ts b/src/app/accounts/verify-recover-delete.component.ts index 95458873..524eaf32 100644 --- a/src/app/accounts/verify-recover-delete.component.ts +++ b/src/app/accounts/verify-recover-delete.component.ts @@ -13,6 +13,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { VerifyDeleteRecoverRequest } from 'jslib-common/models/request/verifyDeleteRecoverRequest'; @@ -29,7 +30,7 @@ export class VerifyRecoverDeleteComponent implements OnInit { constructor(private router: Router, private apiService: ApiService, private toasterService: ToasterService, private i18nService: I18nService, - private route: ActivatedRoute) { + private route: ActivatedRoute, private logService: LogService) { } ngOnInit() { @@ -52,6 +53,8 @@ export class VerifyRecoverDeleteComponent implements OnInit { this.toasterService.popAsync('success', this.i18nService.t('accountDeleted'), this.i18nService.t('accountDeletedDesc')); this.router.navigate(['/']); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/common/base.people.component.ts b/src/app/common/base.people.component.ts index 9ce01ea2..b7033f3d 100644 --- a/src/app/common/base.people.component.ts +++ b/src/app/common/base.people.component.ts @@ -94,7 +94,7 @@ export abstract class BasePeopleComponent>; @@ -256,7 +256,9 @@ export abstract class BasePeopleComponent { @@ -128,7 +129,9 @@ export class CollectionsComponent implements OnInit { await this.apiService.deleteCollection(this.organizationId, collection.id); this.toasterService.popAsync('success', null, this.i18nService.t('deletedCollectionId', collection.name)); this.removeCollection(collection); - } catch { } + } catch (e) { + this.logService.error(e); + } } async users(collection: CollectionView) { diff --git a/src/app/organizations/manage/entity-events.component.ts b/src/app/organizations/manage/entity-events.component.ts index dcd3c79b..ceadd483 100644 --- a/src/app/organizations/manage/entity-events.component.ts +++ b/src/app/organizations/manage/entity-events.component.ts @@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { EventService } from '../../services/event.service'; @@ -42,7 +43,7 @@ export class EntityEventsComponent implements OnInit { constructor(private apiService: ApiService, private i18nService: I18nService, private eventService: EventService, private toasterService: ToasterService, - private userNamePipe: UserNamePipe) { } + private userNamePipe: UserNamePipe, private logService: LogService) { } async ngOnInit() { const defaultDates = this.eventService.getDefaultDateFilters(); @@ -98,7 +99,9 @@ export class EntityEventsComponent implements OnInit { this.morePromise = promise; } response = await promise; - } catch { } + } catch (e) { + this.logService.error(e); + } this.continuationToken = response.continuationToken; const events = await Promise.all(response.data.map(async r => { diff --git a/src/app/organizations/manage/entity-users.component.ts b/src/app/organizations/manage/entity-users.component.ts index 3b42c97a..999e8cf3 100644 --- a/src/app/organizations/manage/entity-users.component.ts +++ b/src/app/organizations/manage/entity-users.component.ts @@ -10,6 +10,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { OrganizationUserStatusType } from 'jslib-common/enums/organizationUserStatusType'; import { OrganizationUserType } from 'jslib-common/enums/organizationUserType'; @@ -41,7 +42,7 @@ export class EntityUsersComponent implements OnInit { private allUsers: OrganizationUserUserDetailsResponse[] = []; constructor(private apiService: ApiService, private i18nService: I18nService, - private toasterService: ToasterService) { } + private toasterService: ToasterService, private logService: LogService) { } async ngOnInit() { await this.loadUsers(); @@ -130,6 +131,8 @@ export class EntityUsersComponent implements OnInit { await this.formPromise; this.toasterService.popAsync('success', null, this.i18nService.t('updatedUsers')); this.onEditedUsers.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/organizations/manage/group-add-edit.component.ts b/src/app/organizations/manage/group-add-edit.component.ts index 2f1474b1..991e9744 100644 --- a/src/app/organizations/manage/group-add-edit.component.ts +++ b/src/app/organizations/manage/group-add-edit.component.ts @@ -11,6 +11,7 @@ import { ToasterService } from 'angular2-toaster'; import { ApiService } from 'jslib-common/abstractions/api.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 { CollectionData } from 'jslib-common/models/data/collectionData'; @@ -42,7 +43,7 @@ export class GroupAddEditComponent implements OnInit { constructor(private apiService: ApiService, private i18nService: I18nService, private toasterService: ToasterService, private collectionService: CollectionService, - private platformUtilsService: PlatformUtilsService) { } + private platformUtilsService: PlatformUtilsService, private logService: LogService) { } async ngOnInit() { this.editMode = this.loading = this.groupId != null; @@ -66,7 +67,9 @@ export class GroupAddEditComponent implements OnInit { } }); } - } catch { } + } catch (e) { + this.logService.error(e); + } } else { this.title = this.i18nService.t('addGroup'); } @@ -112,7 +115,9 @@ export class GroupAddEditComponent implements OnInit { this.toasterService.popAsync('success', null, this.i18nService.t(this.editMode ? 'editedGroupId' : 'createdGroupId', this.name)); this.onSavedGroup.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } async delete() { @@ -132,6 +137,8 @@ export class GroupAddEditComponent implements OnInit { await this.deletePromise; this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', this.name)); this.onDeletedGroup.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/organizations/manage/groups.component.ts b/src/app/organizations/manage/groups.component.ts index 7b7ec1cc..65ab870e 100644 --- a/src/app/organizations/manage/groups.component.ts +++ b/src/app/organizations/manage/groups.component.ts @@ -15,6 +15,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { SearchService } from 'jslib-common/abstractions/search.service'; import { UserService } from 'jslib-common/abstractions/user.service'; @@ -51,7 +52,7 @@ export class GroupsComponent implements OnInit { private i18nService: I18nService, private modalService: ModalService, private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService, private userService: UserService, private router: Router, - private searchService: SearchService) { } + private searchService: SearchService, private logService: LogService) { } async ngOnInit() { this.route.parent.parent.params.subscribe(async params => { @@ -124,7 +125,9 @@ export class GroupsComponent implements OnInit { await this.apiService.deleteGroup(this.organizationId, group.id); this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', group.name)); this.removeGroup(group); - } catch { } + } catch (e) { + this.logService.error(e); + } } async users(group: GroupResponse) { diff --git a/src/app/organizations/manage/policy-edit.component.ts b/src/app/organizations/manage/policy-edit.component.ts index cc7269c0..c4105aae 100644 --- a/src/app/organizations/manage/policy-edit.component.ts +++ b/src/app/organizations/manage/policy-edit.component.ts @@ -13,6 +13,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { PolicyType } from 'jslib-common/enums/policyType'; @@ -45,7 +46,7 @@ export class PolicyEditComponent { constructor(private apiService: ApiService, private i18nService: I18nService, private toasterService: ToasterService, private componentFactoryResolver: ComponentFactoryResolver, - private cdr: ChangeDetectorRef) { + private cdr: ChangeDetectorRef, private logService: LogService) { } async ngAfterViewInit() { @@ -86,6 +87,8 @@ export class PolicyEditComponent { await this.formPromise; this.toasterService.popAsync('success', null, this.i18nService.t('editedPolicyId', this.i18nService.t(this.policy.name))); this.onSavedPolicy.emit(); - } catch {} + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/organizations/manage/reset-password.component.ts b/src/app/organizations/manage/reset-password.component.ts index 493318f7..9003716c 100644 --- a/src/app/organizations/manage/reset-password.component.ts +++ b/src/app/organizations/manage/reset-password.component.ts @@ -9,6 +9,7 @@ import { 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 { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { PolicyService } from 'jslib-common/abstractions/policy.service'; @@ -39,7 +40,7 @@ export class ResetPasswordComponent implements OnInit { constructor(private apiService: ApiService, private i18nService: I18nService, private platformUtilsService: PlatformUtilsService, private passwordGenerationService: PasswordGenerationService, - private policyService: PolicyService, private cryptoService: CryptoService) { } + private policyService: PolicyService, private cryptoService: CryptoService, private logService: LogService) { } async ngOnInit() { // Get Enforced Policy Options @@ -143,7 +144,9 @@ export class ResetPasswordComponent implements OnInit { await this.formPromise; this.platformUtilsService.showToast('success', null, this.i18nService.t('resetPasswordSuccess')); this.onPasswordReset.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } updatePasswordStrength() { diff --git a/src/app/organizations/manage/user-add-edit.component.ts b/src/app/organizations/manage/user-add-edit.component.ts index 308ff8ea..cb05dbe8 100644 --- a/src/app/organizations/manage/user-add-edit.component.ts +++ b/src/app/organizations/manage/user-add-edit.component.ts @@ -11,6 +11,7 @@ import { ToasterService } from 'angular2-toaster'; import { ApiService } from 'jslib-common/abstractions/api.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 { CollectionData } from 'jslib-common/models/data/collectionData'; @@ -85,7 +86,7 @@ export class UserAddEditComponent implements OnInit { constructor(private apiService: ApiService, private i18nService: I18nService, private toasterService: ToasterService, private collectionService: CollectionService, - private platformUtilsService: PlatformUtilsService) { } + private platformUtilsService: PlatformUtilsService, private logService: LogService) { } async ngOnInit() { this.editMode = this.loading = this.organizationUserId != null; @@ -111,7 +112,9 @@ export class UserAddEditComponent implements OnInit { } }); } - } catch { } + } catch (e) { + this.logService.error(e); + } } else { this.title = this.i18nService.t('inviteUser'); } @@ -180,7 +183,9 @@ export class UserAddEditComponent implements OnInit { this.toasterService.popAsync('success', null, this.i18nService.t(this.editMode ? 'editedUserId' : 'invitedUsers', this.name)); this.onSavedUser.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } async delete() { @@ -200,6 +205,8 @@ export class UserAddEditComponent implements OnInit { await this.deletePromise; this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', this.name)); this.onDeletedUser.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/organizations/manage/user-confirm.component.ts b/src/app/organizations/manage/user-confirm.component.ts index 14e6bd4e..2c7dbab3 100644 --- a/src/app/organizations/manage/user-confirm.component.ts +++ b/src/app/organizations/manage/user-confirm.component.ts @@ -9,6 +9,7 @@ import { import { ConstantsService } from 'jslib-common/services/constants.service'; import { CryptoService } from 'jslib-common/abstractions/crypto.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { StorageService } from 'jslib-common/abstractions/storage.service'; @Component({ @@ -26,7 +27,8 @@ export class UserConfirmComponent implements OnInit { fingerprint: string; formPromise: Promise; - constructor(private cryptoService: CryptoService, private storageService: StorageService) { } + constructor(private cryptoService: CryptoService, private storageService: StorageService, + private logService: LogService) { } async ngOnInit() { try { @@ -36,7 +38,9 @@ export class UserConfirmComponent implements OnInit { this.fingerprint = fingerprint.join('-'); } } - } catch { } + } catch (e) { + this.logService.error(e); + } this.loading = false; } diff --git a/src/app/organizations/manage/user-groups.component.ts b/src/app/organizations/manage/user-groups.component.ts index aaf22071..5b71c598 100644 --- a/src/app/organizations/manage/user-groups.component.ts +++ b/src/app/organizations/manage/user-groups.component.ts @@ -10,6 +10,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { OrganizationUserUpdateGroupsRequest } from 'jslib-common/models/request/organizationUserUpdateGroupsRequest'; import { GroupResponse } from 'jslib-common/models/response/groupResponse'; @@ -31,7 +32,7 @@ export class UserGroupsComponent implements OnInit { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private toasterService: ToasterService) { } + private toasterService: ToasterService, private logService: LogService) { } async ngOnInit() { const groupsResponse = await this.apiService.getGroups(this.organizationId); @@ -50,7 +51,9 @@ export class UserGroupsComponent implements OnInit { } }); } - } catch { } + } catch (e) { + this.logService.error(e); + } this.loading = false; } @@ -76,6 +79,8 @@ export class UserGroupsComponent implements OnInit { await this.formPromise; this.toasterService.popAsync('success', null, this.i18nService.t('editedGroupsForUser', this.name)); this.onSavedUser.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/organizations/settings/account.component.ts b/src/app/organizations/settings/account.component.ts index 4cb9a5c3..fe1c4348 100644 --- a/src/app/organizations/settings/account.component.ts +++ b/src/app/organizations/settings/account.component.ts @@ -12,6 +12,7 @@ import { ModalService } from 'jslib-angular/services/modal.service'; 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 { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { SyncService } from 'jslib-common/abstractions/sync.service'; @@ -50,7 +51,7 @@ export class AccountComponent { private apiService: ApiService, private i18nService: I18nService, private toasterService: ToasterService, private route: ActivatedRoute, private syncService: SyncService, private platformUtilsService: PlatformUtilsService, - private cryptoService: CryptoService) { } + private cryptoService: CryptoService, private logService: LogService) { } async ngOnInit() { this.selfHosted = this.platformUtilsService.isSelfHost(); @@ -59,7 +60,9 @@ export class AccountComponent { try { this.org = await this.apiService.getOrganization(this.organizationId); this.canUseApi = this.org.useApi; - } catch { } + } catch (e) { + this.logService.error(e); + } }); this.loading = false; } @@ -84,7 +87,9 @@ export class AccountComponent { }); await this.formPromise; this.toasterService.popAsync('success', null, this.i18nService.t('organizationUpdated')); - } catch { } + } catch (e) { + this.logService.error(e); + } } async submitTaxInfo() { diff --git a/src/app/organizations/settings/adjust-subscription.component.ts b/src/app/organizations/settings/adjust-subscription.component.ts index 31990bbf..0a477f20 100644 --- a/src/app/organizations/settings/adjust-subscription.component.ts +++ b/src/app/organizations/settings/adjust-subscription.component.ts @@ -5,12 +5,12 @@ import { Output, } from '@angular/core'; -import { Router } from '@angular/router'; - import { ToasterService } from 'angular2-toaster'; 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 { OrganizationSubscriptionUpdateRequest } from 'jslib-common/models/request/organizationSubscriptionUpdateRequest'; @Component({ @@ -31,7 +31,7 @@ export class AdjustSubscription { newMaxSeats: number; constructor(private apiService: ApiService, private i18nService: I18nService, - private toasterService: ToasterService) { } + private toasterService: ToasterService, private logService: LogService) { } ngOnInit() { this.limitSubscription = this.maxAutoscaleSeats != null; @@ -48,7 +48,9 @@ export class AdjustSubscription { await this.formPromise; this.toasterService.popAsync('success', null, this.i18nService.t('subscriptionUpdated')); - } catch { } + } catch (e) { + this.logService.error(e); + } this.onAdjusted.emit(); } diff --git a/src/app/organizations/settings/change-plan.component.ts b/src/app/organizations/settings/change-plan.component.ts index 200c2e47..2c867320 100644 --- a/src/app/organizations/settings/change-plan.component.ts +++ b/src/app/organizations/settings/change-plan.component.ts @@ -5,8 +5,7 @@ import { Output, } from '@angular/core'; -import { ApiService } from 'jslib-common/abstractions/api.service'; -import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PlanType } from 'jslib-common/enums/planType'; import { ProductType } from 'jslib-common/enums/productType'; @@ -24,12 +23,14 @@ export class ChangePlanComponent { defaultUpgradePlan: PlanType = PlanType.FamiliesAnnually; defaultUpgradeProduct: ProductType = ProductType.Families; - constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService) { } + constructor(private logService: LogService) { } async submit() { try { this.onChanged.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } cancel() { diff --git a/src/app/organizations/settings/delete-organization.component.ts b/src/app/organizations/settings/delete-organization.component.ts index d1da28b7..7a4832b7 100644 --- a/src/app/organizations/settings/delete-organization.component.ts +++ b/src/app/organizations/settings/delete-organization.component.ts @@ -6,6 +6,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { PasswordVerificationRequest } from 'jslib-common/models/request/passwordVerificationRequest'; @@ -21,7 +22,7 @@ export class DeleteOrganizationComponent { constructor(private apiService: ApiService, private i18nService: I18nService, private toasterService: ToasterService, private cryptoService: CryptoService, - private router: Router) { } + private router: Router, private logService: LogService) { } async submit() { if (this.masterPassword == null || this.masterPassword === '') { @@ -38,6 +39,8 @@ export class DeleteOrganizationComponent { this.toasterService.popAsync('success', this.i18nService.t('organizationDeleted'), this.i18nService.t('organizationDeletedDesc')); this.router.navigate(['/']); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/organizations/settings/download-license.component.ts b/src/app/organizations/settings/download-license.component.ts index 52eccdce..7ac8572a 100644 --- a/src/app/organizations/settings/download-license.component.ts +++ b/src/app/organizations/settings/download-license.component.ts @@ -6,6 +6,7 @@ import { } from '@angular/core'; import { ApiService } from 'jslib-common/abstractions/api.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; @Component({ @@ -20,7 +21,8 @@ export class DownloadLicenseComponent { installationId: string; formPromise: Promise; - constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService) { } + constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService, + private logService: LogService) { } async submit() { if (this.installationId == null || this.installationId === '') { @@ -33,7 +35,9 @@ export class DownloadLicenseComponent { const licenseString = JSON.stringify(license, null, 2); this.platformUtilsService.saveFile(window, licenseString, null, 'bitwarden_organization_license.json'); this.onDownloaded.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } cancel() { diff --git a/src/app/organizations/settings/organization-billing.component.ts b/src/app/organizations/settings/organization-billing.component.ts index 18d058c3..8666888c 100644 --- a/src/app/organizations/settings/organization-billing.component.ts +++ b/src/app/organizations/settings/organization-billing.component.ts @@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { UserBillingComponent } from '../../settings/user-billing.component'; @@ -18,8 +19,9 @@ import { UserBillingComponent } from '../../settings/user-billing.component'; }) export class OrganizationBillingComponent extends UserBillingComponent implements OnInit { constructor(apiService: ApiService, i18nService: I18nService, toasterService: ToasterService, - private route: ActivatedRoute, platformUtilsService: PlatformUtilsService) { - super(apiService, i18nService, toasterService, platformUtilsService); + private route: ActivatedRoute, platformUtilsService: PlatformUtilsService, + logService: LogService) { + super(apiService, i18nService, toasterService, platformUtilsService, logService); } async ngOnInit() { diff --git a/src/app/organizations/settings/organization-subscription.component.ts b/src/app/organizations/settings/organization-subscription.component.ts index cbe8e918..51d157f2 100644 --- a/src/app/organizations/settings/organization-subscription.component.ts +++ b/src/app/organizations/settings/organization-subscription.component.ts @@ -10,6 +10,7 @@ import { OrganizationSubscriptionResponse } from 'jslib-common/models/response/o 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 { MessagingService } from 'jslib-common/abstractions/messaging.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { UserService } from 'jslib-common/abstractions/user.service'; @@ -43,7 +44,7 @@ export class OrganizationSubscriptionComponent implements OnInit { constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService, private i18nService: I18nService, private toasterService: ToasterService, private messagingService: MessagingService, private route: ActivatedRoute, - private userService: UserService) { + private userService: UserService, private logService: LogService) { this.selfHosted = platformUtilsService.isSelfHost(); } @@ -82,7 +83,9 @@ export class OrganizationSubscriptionComponent implements OnInit { await this.reinstatePromise; this.toasterService.popAsync('success', null, this.i18nService.t('reinstated')); this.load(); - } catch { } + } catch (e) { + this.logService.error(e); + } } async cancel() { @@ -101,7 +104,9 @@ export class OrganizationSubscriptionComponent implements OnInit { await this.cancelPromise; this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription')); this.load(); - } catch { } + } catch (e) { + this.logService.error(e); + } } async changePlan() { diff --git a/src/app/organizations/tools/export.component.ts b/src/app/organizations/tools/export.component.ts index e68eb5de..8061a0fd 100644 --- a/src/app/organizations/tools/export.component.ts +++ b/src/app/organizations/tools/export.component.ts @@ -5,6 +5,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'; @@ -17,8 +18,10 @@ import { ExportComponent as BaseExportComponent } from '../../tools/export.compo export class ExportComponent extends BaseExportComponent { constructor(cryptoService: CryptoService, i18nService: I18nService, platformUtilsService: PlatformUtilsService, exportService: ExportService, - eventService: EventService, private route: ActivatedRoute, policyService: PolicyService) { - super(cryptoService, i18nService, platformUtilsService, exportService, eventService, policyService); + eventService: EventService, private route: ActivatedRoute, policyService: PolicyService, + logService: LogService) { + super(cryptoService, i18nService, platformUtilsService, exportService, eventService, policyService, + logService); } async ngOnInit() { diff --git a/src/app/organizations/tools/import.component.ts b/src/app/organizations/tools/import.component.ts index 04c5e859..6e3d8655 100644 --- a/src/app/organizations/tools/import.component.ts +++ b/src/app/organizations/tools/import.component.ts @@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; import { ImportService } from 'jslib-common/abstractions/import.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 { UserService } from 'jslib-common/abstractions/user.service'; @@ -24,8 +25,8 @@ export class ImportComponent extends BaseImportComponent { constructor(i18nService: I18nService, toasterService: ToasterService, importService: ImportService, router: Router, private route: ActivatedRoute, platformUtilsService: PlatformUtilsService, policyService: PolicyService, - private userService: UserService) { - super(i18nService, toasterService, importService, router, platformUtilsService, policyService); + private userService: UserService, logService: LogService) { + super(i18nService, toasterService, importService, router, platformUtilsService, policyService, logService); } async ngOnInit() { diff --git a/src/app/organizations/tools/inactive-two-factor-report.component.ts b/src/app/organizations/tools/inactive-two-factor-report.component.ts index b9af91c8..8ee65303 100644 --- a/src/app/organizations/tools/inactive-two-factor-report.component.ts +++ b/src/app/organizations/tools/inactive-two-factor-report.component.ts @@ -2,6 +2,7 @@ import { Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { CipherService } from 'jslib-common/abstractions/cipher.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { MessagingService } from 'jslib-common/abstractions/messaging.service'; import { PasswordRepromptService } from 'jslib-common/abstractions/passwordReprompt.service'; import { UserService } from 'jslib-common/abstractions/user.service'; @@ -20,9 +21,9 @@ import { CipherView } from 'jslib-common/models/view/cipherView'; }) export class InactiveTwoFactorReportComponent extends BaseInactiveTwoFactorReportComponent { constructor(cipherService: CipherService, modalService: ModalService, - messagingService: MessagingService, userService: UserService, passwordRepromptService: PasswordRepromptService, - private route: ActivatedRoute) { - super(cipherService, modalService, messagingService, userService, passwordRepromptService); + messagingService: MessagingService, userService: UserService, + private route: ActivatedRoute, logService: LogService, passwordRepromptService: PasswordRepromptService) { + super(cipherService, modalService, messagingService, userService, logService, passwordRepromptService); } async ngOnInit() { diff --git a/src/app/organizations/vault/add-edit.component.ts b/src/app/organizations/vault/add-edit.component.ts index aa392255..39d661e6 100644 --- a/src/app/organizations/vault/add-edit.component.ts +++ b/src/app/organizations/vault/add-edit.component.ts @@ -7,6 +7,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 { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; @@ -37,10 +38,10 @@ export class AddEditComponent extends BaseAddEditComponent { userService: UserService, collectionService: CollectionService, totpService: TotpService, passwordGenerationService: PasswordGenerationService, private apiService: ApiService, messagingService: MessagingService, - eventService: EventService, policyService: PolicyService) { + eventService: EventService, policyService: PolicyService, logService: LogService) { super(cipherService, folderService, i18nService, platformUtilsService, auditService, stateService, userService, collectionService, totpService, passwordGenerationService, messagingService, - eventService, policyService); + eventService, policyService, logService); } protected allowOwnershipAssignment() { diff --git a/src/app/organizations/vault/attachments.component.ts b/src/app/organizations/vault/attachments.component.ts index 66cca981..c3ce87fc 100644 --- a/src/app/organizations/vault/attachments.component.ts +++ b/src/app/organizations/vault/attachments.component.ts @@ -4,6 +4,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'; @@ -25,8 +26,10 @@ export class AttachmentsComponent extends BaseAttachmentsComponent { constructor(cipherService: CipherService, i18nService: I18nService, cryptoService: CryptoService, userService: UserService, - platformUtilsService: PlatformUtilsService, apiService: ApiService) { - super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService); + platformUtilsService: PlatformUtilsService, apiService: ApiService, + logService: LogService) { + super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService, + logService); } protected async reupload(attachment: AttachmentView) { diff --git a/src/app/organizations/vault/ciphers.component.ts b/src/app/organizations/vault/ciphers.component.ts index 0096743f..0106655e 100644 --- a/src/app/organizations/vault/ciphers.component.ts +++ b/src/app/organizations/vault/ciphers.component.ts @@ -10,6 +10,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service'; import { CipherService } from 'jslib-common/abstractions/cipher.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 { SearchService } from 'jslib-common/abstractions/search.service'; @@ -36,9 +37,10 @@ export class CiphersComponent extends BaseCiphersComponent { constructor(searchService: SearchService, toasterService: ToasterService, i18nService: I18nService, platformUtilsService: PlatformUtilsService, cipherService: CipherService, private apiService: ApiService, eventService: EventService, totpService: TotpService, - userService: UserService, passwordRepromptService: PasswordRepromptService) { + userService: UserService, passwordRepromptService: PasswordRepromptService, + logService: LogService) { super(searchService, toasterService, i18nService, platformUtilsService, cipherService, - eventService, totpService, userService, passwordRepromptService); + eventService, totpService, userService, passwordRepromptService, logService); } async load(filter: (cipher: CipherView) => boolean = null) { diff --git a/src/app/organizations/vault/collections.component.ts b/src/app/organizations/vault/collections.component.ts index 85b10378..a68cda5c 100644 --- a/src/app/organizations/vault/collections.component.ts +++ b/src/app/organizations/vault/collections.component.ts @@ -4,6 +4,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service'; 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 { CipherData } from 'jslib-common/models/data/cipherData'; @@ -22,8 +23,8 @@ export class CollectionsComponent extends BaseCollectionsComponent { constructor(collectionService: CollectionService, platformUtilsService: PlatformUtilsService, i18nService: I18nService, cipherService: CipherService, - private apiService: ApiService) { - super(collectionService, platformUtilsService, i18nService, cipherService); + private apiService: ApiService, logService: LogService) { + super(collectionService, platformUtilsService, i18nService, cipherService, logService); this.allowSelectNone = true; } diff --git a/src/app/send/add-edit.component.ts b/src/app/send/add-edit.component.ts index 819695db..abdfee89 100644 --- a/src/app/send/add-edit.component.ts +++ b/src/app/send/add-edit.component.ts @@ -11,6 +11,7 @@ import { SendService } from 'jslib-common/abstractions/send.service'; import { UserService } from 'jslib-common/abstractions/user.service'; import { AddEditComponent as BaseAddEditComponent } from 'jslib-angular/components/send/add-edit.component'; +import { LogService } from 'jslib-common/abstractions/log.service'; @Component({ selector: 'app-send-add-edit', @@ -20,9 +21,10 @@ export class AddEditComponent extends BaseAddEditComponent { constructor(i18nService: I18nService, platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService, datePipe: DatePipe, sendService: SendService, userService: UserService, - messagingService: MessagingService, policyService: PolicyService) { + messagingService: MessagingService, policyService: PolicyService, + logService: LogService) { super(i18nService, platformUtilsService, environmentService, datePipe, sendService, userService, - messagingService, policyService); + messagingService, policyService, logService); } async copyLinkToClipboard(link: string): Promise { diff --git a/src/app/send/send.component.ts b/src/app/send/send.component.ts index 09eef6c9..f9d42d8c 100644 --- a/src/app/send/send.component.ts +++ b/src/app/send/send.component.ts @@ -13,6 +13,7 @@ import { AddEditComponent } from './add-edit.component'; 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'; @@ -34,9 +35,10 @@ export class SendComponent extends BaseSendComponent { constructor(sendService: SendService, i18nService: I18nService, platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService, ngZone: NgZone, searchService: SearchService, policyService: PolicyService, userService: UserService, - private modalService: ModalService, private broadcasterService: BroadcasterService) { + private modalService: ModalService, private broadcasterService: BroadcasterService, + logService: LogService) { super(sendService, i18nService, platformUtilsService, environmentService, ngZone, searchService, - policyService, userService); + policyService, userService, logService); } async ngOnInit() { diff --git a/src/app/services/services.module.ts b/src/app/services/services.module.ts index 04564d40..4927288c 100644 --- a/src/app/services/services.module.ts +++ b/src/app/services/services.module.ts @@ -116,12 +116,12 @@ const settingsService = new SettingsService(userService, storageService); export let searchService: SearchService = null; const fileUploadService = new FileUploadService(consoleLogService, apiService); const cipherService = new CipherService(cryptoService, userService, settingsService, - apiService, fileUploadService, storageService, i18nService, () => searchService); + apiService, fileUploadService, storageService, i18nService, () => searchService, consoleLogService); const folderService = new FolderService(cryptoService, userService, apiService, storageService, i18nService, cipherService); const collectionService = new CollectionService(cryptoService, userService, storageService, i18nService); searchService = new SearchService(cipherService, consoleLogService, i18nService); -const policyService = new PolicyService(userService, storageService); +const policyService = new PolicyService(userService, storageService, apiService); const sendService = new SendService(cryptoService, userService, apiService, fileUploadService, storageService, i18nService, cryptoFunctionService); const vaultTimeoutService = new VaultTimeoutService(cipherService, folderService, collectionService, @@ -129,9 +129,9 @@ const vaultTimeoutService = new VaultTimeoutService(cipherService, folderService policyService, null, async () => messagingService.send('logout', { expired: false })); const syncService = new SyncService(userService, apiService, settingsService, folderService, cipherService, cryptoService, collectionService, storageService, messagingService, policyService, - sendService, async (expired: boolean) => messagingService.send('logout', { expired: expired })); + sendService, consoleLogService, async (expired: boolean) => messagingService.send('logout', { expired: expired })); const passwordGenerationService = new PasswordGenerationService(cryptoService, storageService, policyService); -const totpService = new TotpService(storageService, cryptoFunctionService); +const totpService = new TotpService(storageService, cryptoFunctionService, consoleLogService); const containerService = new ContainerService(cryptoService); const authService = new AuthService(cryptoService, apiService, userService, tokenService, appIdService, i18nService, platformUtilsService, messagingService, vaultTimeoutService, @@ -142,7 +142,7 @@ const importService = new ImportService(cipherService, folderService, apiService const notificationsService = new NotificationsService(userService, syncService, appIdService, apiService, vaultTimeoutService, environmentService, async () => messagingService.send('logout', { expired: true }), consoleLogService); const auditService = new AuditService(cryptoFunctionService, apiService); -const eventLoggingService = new EventLoggingService(storageService, apiService, userService, cipherService); +const eventLoggingService = new EventLoggingService(storageService, apiService, userService, cipherService, consoleLogService); containerService.attachToWindow(window); diff --git a/src/app/settings/add-credit.component.ts b/src/app/settings/add-credit.component.ts index 479e74c2..68f2f157 100644 --- a/src/app/settings/add-credit.component.ts +++ b/src/app/settings/add-credit.component.ts @@ -10,6 +10,7 @@ import { import { ApiService } from 'jslib-common/abstractions/api.service'; import { PayPalConfig } from 'jslib-common/abstractions/environment.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'; @@ -45,7 +46,7 @@ export class AddCreditComponent implements OnInit { private email: string; constructor(private userService: UserService, private apiService: ApiService, - private platformUtilsService: PlatformUtilsService) { + private platformUtilsService: PlatformUtilsService, private logService: LogService) { const payPalConfig = process.env.PAYPAL_CONFIG as PayPalConfig; this.ppButtonFormAction = payPalConfig.buttonAction; this.ppButtonBusinessId = payPalConfig.businessId; @@ -98,12 +99,16 @@ export class AddCreditComponent implements OnInit { this.formPromise = this.apiService.postBitPayInvoice(req); const bitPayUrl: string = await this.formPromise; this.platformUtilsService.launchUri(bitPayUrl); - } catch { } + } catch (e) { + this.logService.error(e); + } return; } try { this.onAdded.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } cancel() { @@ -120,7 +125,9 @@ export class AddCreditComponent implements OnInit { return; } } - } catch { } + } catch (e) { + this.logService.error(e); + } this.creditAmount = ''; } @@ -128,7 +135,9 @@ export class AddCreditComponent implements OnInit { if (this.creditAmount != null && this.creditAmount !== '') { try { return parseFloat(this.creditAmount); - } catch { } + } catch (e) { + this.logService.error(e); + } } return null; } diff --git a/src/app/settings/adjust-payment.component.ts b/src/app/settings/adjust-payment.component.ts index 0863ea58..3a48e819 100644 --- a/src/app/settings/adjust-payment.component.ts +++ b/src/app/settings/adjust-payment.component.ts @@ -10,6 +10,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { PaymentRequest } from 'jslib-common/models/request/paymentRequest'; @@ -35,7 +36,7 @@ export class AdjustPaymentComponent { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private toasterService: ToasterService) { } + private toasterService: ToasterService, private logService: LogService) { } async submit() { try { @@ -60,7 +61,9 @@ export class AdjustPaymentComponent { await this.formPromise; this.toasterService.popAsync('success', null, this.i18nService.t('updatedPaymentMethod')); this.onAdjusted.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } cancel() { diff --git a/src/app/settings/adjust-storage.component.ts b/src/app/settings/adjust-storage.component.ts index 830b1985..d4aede05 100644 --- a/src/app/settings/adjust-storage.component.ts +++ b/src/app/settings/adjust-storage.component.ts @@ -15,6 +15,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { StorageRequest } from 'jslib-common/models/request/storageRequest'; @@ -41,7 +42,7 @@ export class AdjustStorageComponent { constructor(private apiService: ApiService, private i18nService: I18nService, private toasterService: ToasterService, private router: Router, - private activatedRoute: ActivatedRoute) { } + private activatedRoute: ActivatedRoute, private logService: LogService) { } async submit() { try { @@ -82,7 +83,9 @@ export class AdjustStorageComponent { this.toasterService.popAsync('success', null, this.i18nService.t('adjustedStorage', request.storageGbAdjustment.toString())); } - } catch { } + } catch (e) { + this.logService.error(e); + } } cancel() { diff --git a/src/app/settings/api-key.component.ts b/src/app/settings/api-key.component.ts index bf057bf7..abeee0e5 100644 --- a/src/app/settings/api-key.component.ts +++ b/src/app/settings/api-key.component.ts @@ -4,6 +4,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { PasswordVerificationRequest } from 'jslib-common/models/request/passwordVerificationRequest'; @@ -30,7 +31,7 @@ export class ApiKeyComponent { clientSecret: string; constructor(private i18nService: I18nService, private toasterService: ToasterService, - private cryptoService: CryptoService) { } + private cryptoService: CryptoService, private logService: LogService) { } async submit() { if (this.masterPassword == null || this.masterPassword === '') { @@ -46,6 +47,8 @@ export class ApiKeyComponent { const response = await this.formPromise; this.clientSecret = response.apiKey; this.clientId = `${this.keyType}.${this.entityId}`; - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/settings/change-email.component.ts b/src/app/settings/change-email.component.ts index 82738e8b..421c05b8 100644 --- a/src/app/settings/change-email.component.ts +++ b/src/app/settings/change-email.component.ts @@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { UserService } from 'jslib-common/abstractions/user.service'; @@ -31,7 +32,8 @@ export class ChangeEmailComponent implements OnInit { constructor(private apiService: ApiService, private i18nService: I18nService, private toasterService: ToasterService, private cryptoService: CryptoService, - private messagingService: MessagingService, private userService: UserService) { } + private messagingService: MessagingService, private userService: UserService, + private logService: LogService) { } async ngOnInit() { const twoFactorProviders = await this.apiService.getTwoFactorProviders(); @@ -55,7 +57,9 @@ export class ChangeEmailComponent implements OnInit { this.formPromise = this.apiService.postEmailToken(request); await this.formPromise; this.tokenSent = true; - } catch { } + } catch (e) { + this.logService.error(e); + } } else { const request = new EmailRequest(); request.token = this.token; @@ -74,7 +78,9 @@ export class ChangeEmailComponent implements OnInit { this.toasterService.popAsync('success', this.i18nService.t('emailChanged'), this.i18nService.t('logBackIn')); this.messagingService.send('logout'); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/settings/change-kdf.component.ts b/src/app/settings/change-kdf.component.ts index 5d1ba2bd..94227a3f 100644 --- a/src/app/settings/change-kdf.component.ts +++ b/src/app/settings/change-kdf.component.ts @@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { UserService } from 'jslib-common/abstractions/user.service'; @@ -28,7 +29,8 @@ export class ChangeKdfComponent implements OnInit { constructor(private apiService: ApiService, private i18nService: I18nService, private toasterService: ToasterService, private cryptoService: CryptoService, - private messagingService: MessagingService, private userService: UserService) { + private messagingService: MessagingService, private userService: UserService, + private logService: LogService) { this.kdfOptions = [ { name: 'PBKDF2 SHA-256', value: KdfType.PBKDF2_SHA256 }, ]; @@ -61,6 +63,8 @@ export class ChangeKdfComponent implements OnInit { this.toasterService.popAsync('success', this.i18nService.t('encKeySettingsChanged'), this.i18nService.t('logBackIn')); this.messagingService.send('logout'); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/settings/deauthorize-sessions.component.ts b/src/app/settings/deauthorize-sessions.component.ts index ec605a45..5c839ac2 100644 --- a/src/app/settings/deauthorize-sessions.component.ts +++ b/src/app/settings/deauthorize-sessions.component.ts @@ -5,6 +5,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { PasswordVerificationRequest } from 'jslib-common/models/request/passwordVerificationRequest'; @@ -19,7 +20,7 @@ export class DeauthorizeSessionsComponent { constructor(private apiService: ApiService, private i18nService: I18nService, private toasterService: ToasterService, private cryptoService: CryptoService, - private messagingService: MessagingService) { } + private messagingService: MessagingService, private logService: LogService) { } async submit() { if (this.masterPassword == null || this.masterPassword === '') { @@ -36,6 +37,8 @@ export class DeauthorizeSessionsComponent { this.toasterService.popAsync('success', this.i18nService.t('sessionsDeauthorized'), this.i18nService.t('logBackIn')); this.messagingService.send('logout'); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/settings/delete-account.component.ts b/src/app/settings/delete-account.component.ts index 948ca270..69af0cfc 100644 --- a/src/app/settings/delete-account.component.ts +++ b/src/app/settings/delete-account.component.ts @@ -5,6 +5,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { PasswordVerificationRequest } from 'jslib-common/models/request/passwordVerificationRequest'; @@ -19,7 +20,7 @@ export class DeleteAccountComponent { constructor(private apiService: ApiService, private i18nService: I18nService, private toasterService: ToasterService, private cryptoService: CryptoService, - private messagingService: MessagingService) { } + private messagingService: MessagingService, private logService: LogService) { } async submit() { if (this.masterPassword == null || this.masterPassword === '') { @@ -36,6 +37,8 @@ export class DeleteAccountComponent { this.toasterService.popAsync('success', this.i18nService.t('accountDeleted'), this.i18nService.t('accountDeletedDesc')); this.messagingService.send('logout'); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/settings/domain-rules.component.ts b/src/app/settings/domain-rules.component.ts index be87f683..8e0c8b40 100644 --- a/src/app/settings/domain-rules.component.ts +++ b/src/app/settings/domain-rules.component.ts @@ -7,6 +7,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { UpdateDomainsRequest } from 'jslib-common/models/request/updateDomainsRequest'; @@ -21,7 +22,7 @@ export class DomainRulesComponent implements OnInit { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private toasterService: ToasterService) { } + private toasterService: ToasterService, private logService: LogService) { } async ngOnInit() { const response = await this.apiService.getSettingsDomains(); @@ -74,7 +75,9 @@ export class DomainRulesComponent implements OnInit { this.formPromise = this.apiService.putSettingsDomains(request); await this.formPromise; this.toasterService.popAsync('success', null, this.i18nService.t('domainsUpdated')); - } catch { } + } catch (e) { + this.logService.error(e); + } } indexTrackBy(index: number, obj: any): any { diff --git a/src/app/settings/emergency-access-add-edit.component.ts b/src/app/settings/emergency-access-add-edit.component.ts index 999045d6..53417ef2 100644 --- a/src/app/settings/emergency-access-add-edit.component.ts +++ b/src/app/settings/emergency-access-add-edit.component.ts @@ -10,6 +10,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { EmergencyAccessType } from 'jslib-common/enums/emergencyAccessType'; import { EmergencyAccessInviteRequest } from 'jslib-common/models/request/emergencyAccessInviteRequest'; @@ -39,7 +40,7 @@ export class EmergencyAccessAddEditComponent implements OnInit { waitTime: number; constructor(private apiService: ApiService, private i18nService: I18nService, - private toasterService: ToasterService) { } + private toasterService: ToasterService, private logService: LogService) { } async ngOnInit() { this.editMode = this.loading = this.emergencyAccessId != null; @@ -60,7 +61,9 @@ export class EmergencyAccessAddEditComponent implements OnInit { const emergencyAccess = await this.apiService.getEmergencyAccess(this.emergencyAccessId); this.type = emergencyAccess.type; this.waitTime = emergencyAccess.waitTimeDays; - } catch { } + } catch (e) { + this.logService.error(e); + } } else { this.title = this.i18nService.t('inviteEmergencyContact'); this.waitTime = this.waitTimes[2].value; @@ -90,7 +93,9 @@ export class EmergencyAccessAddEditComponent implements OnInit { this.toasterService.popAsync('success', null, this.i18nService.t(this.editMode ? 'editedUserId' : 'invitedUsers', this.name)); this.onSaved.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } async delete() { diff --git a/src/app/settings/emergency-access-attachments.component.ts b/src/app/settings/emergency-access-attachments.component.ts index 4d872630..ad69500d 100644 --- a/src/app/settings/emergency-access-attachments.component.ts +++ b/src/app/settings/emergency-access-attachments.component.ts @@ -4,6 +4,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'; @@ -21,8 +22,10 @@ export class EmergencyAccessAttachmentsComponent extends BaseAttachmentsComponen constructor(cipherService: CipherService, i18nService: I18nService, cryptoService: CryptoService, userService: UserService, - platformUtilsService: PlatformUtilsService, apiService: ApiService) { - super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService, window); + platformUtilsService: PlatformUtilsService, apiService: ApiService, + logService: LogService) { + super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService, window, + logService); } protected async init() { diff --git a/src/app/settings/emergency-access-confirm.component.ts b/src/app/settings/emergency-access-confirm.component.ts index 224924fd..2be2bb79 100644 --- a/src/app/settings/emergency-access-confirm.component.ts +++ b/src/app/settings/emergency-access-confirm.component.ts @@ -10,6 +10,7 @@ import { ConstantsService } from 'jslib-common/services/constants.service'; import { ApiService } from 'jslib-common/abstractions/api.service'; import { CryptoService } from 'jslib-common/abstractions/crypto.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { StorageService } from 'jslib-common/abstractions/storage.service'; import { Utils } from 'jslib-common/misc/utils'; @@ -30,7 +31,7 @@ export class EmergencyAccessConfirmComponent implements OnInit { fingerprint: string; constructor(private apiService: ApiService, private cryptoService: CryptoService, - private storageService: StorageService) { } + private storageService: StorageService, private logService: LogService) { } async ngOnInit() { try { @@ -42,7 +43,9 @@ export class EmergencyAccessConfirmComponent implements OnInit { this.fingerprint = fingerprint.join('-'); } } - } catch { } + } catch (e) { + this.logService.error(e); + } this.loading = false; } @@ -57,6 +60,8 @@ export class EmergencyAccessConfirmComponent implements OnInit { try { this.onConfirmed.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/settings/emergency-access-takeover.component.ts b/src/app/settings/emergency-access-takeover.component.ts index 6d5673d5..3875f040 100644 --- a/src/app/settings/emergency-access-takeover.component.ts +++ b/src/app/settings/emergency-access-takeover.component.ts @@ -11,6 +11,7 @@ import { ToasterService } from 'angular2-toaster'; 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'; @@ -44,7 +45,7 @@ export class EmergencyAccessTakeoverComponent extends ChangePasswordComponent im messagingService: MessagingService, userService: UserService, passwordGenerationService: PasswordGenerationService, platformUtilsService: PlatformUtilsService, policyService: PolicyService, - private apiService: ApiService, private toasterService: ToasterService) { + private apiService: ApiService, private toasterService: ToasterService, private logService: LogService) { super(i18nService, cryptoService, messagingService, userService, passwordGenerationService, platformUtilsService, policyService); } @@ -85,6 +86,8 @@ export class EmergencyAccessTakeoverComponent extends ChangePasswordComponent im try { this.onDone.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/settings/emergency-access.component.ts b/src/app/settings/emergency-access.component.ts index 8ca04dba..de88015b 100644 --- a/src/app/settings/emergency-access.component.ts +++ b/src/app/settings/emergency-access.component.ts @@ -9,6 +9,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { StorageService } from 'jslib-common/abstractions/storage.service'; @@ -50,7 +51,8 @@ export class EmergencyAccessComponent implements OnInit { private modalService: ModalService, private platformUtilsService: PlatformUtilsService, private toasterService: ToasterService, private cryptoService: CryptoService, private storageService: StorageService, private userService: UserService, - private messagingService: MessagingService, private userNamePipe: UserNamePipe) { } + private messagingService: MessagingService, private userNamePipe: UserNamePipe, + private logService: LogService) { } async ngOnInit() { this.canAccessPremium = await this.userService.canAccessPremium(); @@ -154,7 +156,9 @@ export class EmergencyAccessComponent implements OnInit { } else { this.removeGrantor(details); } - } catch { } + } catch (e) { + this.logService.error(e); + } } async requestAccess(details: EmergencyAccessGrantorDetailsResponse) { @@ -238,10 +242,11 @@ export class EmergencyAccessComponent implements OnInit { const publicKey = Utils.fromB64ToArray(publicKeyResponse.publicKey); try { - // tslint:disable-next-line - console.log('User\'s fingerprint: ' + + this.logService.debug('User\'s fingerprint: ' + (await this.cryptoService.getFingerprint(details.granteeId, publicKey.buffer)).join('-')); - } catch { } + } catch { + // Ignore errors since it's just a debug message + } const encryptedKey = await this.cryptoService.rsaEncrypt(encKey.key, publicKey.buffer); const request = new EmergencyAccessConfirmRequest(); diff --git a/src/app/settings/emergency-add-edit.component.ts b/src/app/settings/emergency-add-edit.component.ts index 6ac66abf..a20c7a08 100644 --- a/src/app/settings/emergency-add-edit.component.ts +++ b/src/app/settings/emergency-add-edit.component.ts @@ -6,6 +6,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 { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; @@ -31,10 +32,11 @@ export class EmergencyAddEditComponent extends BaseAddEditComponent { auditService: AuditService, stateService: StateService, userService: UserService, collectionService: CollectionService, totpService: TotpService, passwordGenerationService: PasswordGenerationService, - messagingService: MessagingService, eventService: EventService, policyService: PolicyService) { + messagingService: MessagingService, eventService: EventService, policyService: PolicyService, + logService: LogService) { super(cipherService, folderService, i18nService, platformUtilsService, auditService, stateService, userService, collectionService, totpService, passwordGenerationService, messagingService, - eventService, policyService); + eventService, policyService, logService); } async load() { diff --git a/src/app/settings/link-sso.component.ts b/src/app/settings/link-sso.component.ts index a8ef0594..6beb833e 100644 --- a/src/app/settings/link-sso.component.ts +++ b/src/app/settings/link-sso.component.ts @@ -10,6 +10,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'; @@ -31,12 +32,13 @@ export class LinkSsoComponent extends SsoComponent implements AfterContentInit { apiService: ApiService, authService: AuthService, router: Router, route: ActivatedRoute, cryptoFunctionService: CryptoFunctionService, passwordGenerationService: PasswordGenerationService, - storageService: StorageService, stateService: StateService, environmentService: EnvironmentService) { + storageService: StorageService, stateService: StateService, environmentService: EnvironmentService, + logService: LogService) { super(authService, router, i18nService, route, storageService, stateService, platformUtilsService, apiService, - cryptoFunctionService, environmentService, passwordGenerationService); + cryptoFunctionService, environmentService, passwordGenerationService, logService); this.returnUri = '/settings/organizations'; this.redirectUri = window.location.origin + '/sso-connector.html'; diff --git a/src/app/settings/organization-plans.component.ts b/src/app/settings/organization-plans.component.ts index f2e9b2dd..6d872c6b 100644 --- a/src/app/settings/organization-plans.component.ts +++ b/src/app/settings/organization-plans.component.ts @@ -13,6 +13,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { PolicyService } from 'jslib-common/abstractions/policy.service'; import { SyncService } from 'jslib-common/abstractions/sync.service'; @@ -24,8 +25,6 @@ import { TaxInfoComponent } from './tax-info.component'; import { EncString } from 'jslib-common/models/domain/encString'; import { SymmetricCryptoKey } from 'jslib-common/models/domain/symmetricCryptoKey'; -import { OrganizationUserStatusType } from 'jslib-common/enums/organizationUserStatusType'; -import { OrganizationUserType } from 'jslib-common/enums/organizationUserType'; import { PaymentMethodType } from 'jslib-common/enums/paymentMethodType'; import { PlanType } from 'jslib-common/enums/planType'; import { PolicyType } from 'jslib-common/enums/policyType'; @@ -75,7 +74,7 @@ export class OrganizationPlansComponent implements OnInit { constructor(private apiService: ApiService, private i18nService: I18nService, private toasterService: ToasterService, platformUtilsService: PlatformUtilsService, private cryptoService: CryptoService, private router: Router, private syncService: SyncService, - private policyService: PolicyService, private userService: UserService) { + private policyService: PolicyService, private userService: UserService, private logService: LogService) { this.selfHosted = platformUtilsService.isSelfHost(); } @@ -264,7 +263,9 @@ export class OrganizationPlansComponent implements OnInit { this.formPromise = doSubmit(); await this.formPromise; this.onSuccess.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } private async userHasBlockingSingleOrgPolicy() { diff --git a/src/app/settings/organizations.component.ts b/src/app/settings/organizations.component.ts index 78a47bef..1d893e41 100644 --- a/src/app/settings/organizations.component.ts +++ b/src/app/settings/organizations.component.ts @@ -9,6 +9,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { PolicyService } from 'jslib-common/abstractions/policy.service'; import { SyncService } from 'jslib-common/abstractions/sync.service'; @@ -38,7 +39,8 @@ export class OrganizationsComponent implements OnInit { constructor(private userService: UserService, private platformUtilsService: PlatformUtilsService, private i18nService: I18nService, private apiService: ApiService, private toasterService: ToasterService, private syncService: SyncService, - private cryptoService: CryptoService, private policyService: PolicyService) { } + private cryptoService: CryptoService, private policyService: PolicyService, + private logService: LogService) { } async ngOnInit() { if (!this.vault) { @@ -85,7 +87,9 @@ export class OrganizationsComponent implements OnInit { await this.actionPromise; this.toasterService.popAsync('success', null, 'Unlinked SSO'); await this.load(); - } catch { } + } catch (e) { + this.logService.error(e); + } } async leave(org: Organization) { @@ -103,7 +107,9 @@ export class OrganizationsComponent implements OnInit { await this.actionPromise; this.toasterService.popAsync('success', null, this.i18nService.t('leftOrganization')); await this.load(); - } catch { } + } catch (e) { + this.logService.error(e); + } } async toggleResetPasswordEnrollment(org: Organization) { @@ -158,6 +164,8 @@ export class OrganizationsComponent implements OnInit { await this.actionPromise; this.platformUtilsService.showToast('success', null, this.i18nService.t(toastStringRef)); await this.load(); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/settings/payment.component.ts b/src/app/settings/payment.component.ts index 0c8b11a5..5495df22 100644 --- a/src/app/settings/payment.component.ts +++ b/src/app/settings/payment.component.ts @@ -7,6 +7,7 @@ import { import { PaymentMethodType } from 'jslib-common/enums/paymentMethodType'; import { ApiService } from 'jslib-common/abstractions/api.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { ThemeType } from 'jslib-common/enums/themeType'; @@ -52,7 +53,8 @@ export class PaymentComponent implements OnInit { private StripeElementStyle: any; private StripeElementClasses: any; - constructor(private platformUtilsService: PlatformUtilsService, private apiService: ApiService) { + constructor(private platformUtilsService: PlatformUtilsService, private apiService: ApiService, + private logService: LogService) { this.stripeScript = window.document.createElement('script'); this.stripeScript.src = 'https://js.stripe.com/v3/'; this.stripeScript.async = true; @@ -107,7 +109,9 @@ export class PaymentComponent implements OnInit { if (el.src != null && el.src.indexOf('stripe') > -1) { try { window.document.body.removeChild(el); - } catch { } + } catch (e) { + this.logService.error(e); + } } }); }, 500); @@ -118,14 +122,18 @@ export class PaymentComponent implements OnInit { if (el.src != null && el.src.indexOf('paypal') > -1) { try { window.document.head.removeChild(el); - } catch { } + } catch (e) { + this.logService.error(e); + } } }); const btStylesheet = window.document.head.querySelector('#braintree-dropin-stylesheet'); if (btStylesheet != null) { try { window.document.head.removeChild(btStylesheet); - } catch { } + } catch (e) { + this.logService.error(e); + } } }, 500); } diff --git a/src/app/settings/premium.component.ts b/src/app/settings/premium.component.ts index f0ca574f..089b08b4 100644 --- a/src/app/settings/premium.component.ts +++ b/src/app/settings/premium.component.ts @@ -9,6 +9,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { MessagingService } from 'jslib-common/abstractions/messaging.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { SyncService } from 'jslib-common/abstractions/sync.service'; @@ -38,7 +39,7 @@ export class PremiumComponent implements OnInit { private toasterService: ToasterService, platformUtilsService: PlatformUtilsService, private tokenService: TokenService, private router: Router, private messagingService: MessagingService, private syncService: SyncService, - private userService: UserService) { + private userService: UserService, private logService: LogService) { this.selfHosted = platformUtilsService.isSelfHost(); } @@ -97,7 +98,9 @@ export class PremiumComponent implements OnInit { }); } await this.formPromise; - } catch { } + } catch (e) { + this.logService.error(e); + } } async finalizePremium() { diff --git a/src/app/settings/profile.component.ts b/src/app/settings/profile.component.ts index 0ec736a9..64cc4515 100644 --- a/src/app/settings/profile.component.ts +++ b/src/app/settings/profile.component.ts @@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { UserService } from 'jslib-common/abstractions/user.service'; import { UpdateProfileRequest } from 'jslib-common/models/request/updateProfileRequest'; @@ -27,7 +28,7 @@ export class ProfileComponent implements OnInit { constructor(private apiService: ApiService, private i18nService: I18nService, private toasterService: ToasterService, private userService: UserService, - private cryptoService: CryptoService) { } + private cryptoService: CryptoService, private logService: LogService) { } async ngOnInit() { this.profile = await this.apiService.getProfile(); @@ -44,6 +45,8 @@ export class ProfileComponent implements OnInit { this.formPromise = this.apiService.putProfile(request); await this.formPromise; this.toasterService.popAsync('success', null, this.i18nService.t('accountUpdated')); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/settings/purge-vault.component.ts b/src/app/settings/purge-vault.component.ts index 3d77acfb..a5935a3f 100644 --- a/src/app/settings/purge-vault.component.ts +++ b/src/app/settings/purge-vault.component.ts @@ -9,6 +9,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { PasswordVerificationRequest } from 'jslib-common/models/request/passwordVerificationRequest'; @@ -24,7 +25,7 @@ export class PurgeVaultComponent { constructor(private apiService: ApiService, private i18nService: I18nService, private toasterService: ToasterService, private cryptoService: CryptoService, - private router: Router) { } + private router: Router, private logService: LogService) { } async submit() { if (this.masterPassword == null || this.masterPassword === '') { @@ -44,6 +45,8 @@ export class PurgeVaultComponent { } else { this.router.navigate(['vault']); } - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/settings/tax-info.component.ts b/src/app/settings/tax-info.component.ts index cc349cfe..b9261a97 100644 --- a/src/app/settings/tax-info.component.ts +++ b/src/app/settings/tax-info.component.ts @@ -5,6 +5,7 @@ import { } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { ApiService } from 'jslib-common/abstractions/api.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { OrganizationTaxInfoUpdateRequest } from 'jslib-common/models/request/organizationTaxInfoUpdateRequest'; import { TaxInfoUpdateRequest } from 'jslib-common/models/request/taxInfoUpdateRequest'; import { TaxRateResponse } from 'jslib-common/models/response/taxRateResponse'; @@ -42,7 +43,7 @@ export class TaxInfoComponent { includeTaxId: false, }; - constructor(private apiService: ApiService, private route: ActivatedRoute) { } + constructor(private apiService: ApiService, private route: ActivatedRoute, private logService: LogService) { } async ngOnInit() { this.route.parent.parent.params.subscribe(async params => { @@ -66,7 +67,9 @@ export class TaxInfoComponent { || !!taxInfo.city || !!taxInfo.state); } - } catch { } + } catch (e) { + this.logService.error(e); + } } else { const taxInfo = await this.apiService.getTaxInfo(); if (taxInfo) { diff --git a/src/app/settings/two-factor-authenticator.component.ts b/src/app/settings/two-factor-authenticator.component.ts index 7e4e2051..0e68221f 100644 --- a/src/app/settings/two-factor-authenticator.component.ts +++ b/src/app/settings/two-factor-authenticator.component.ts @@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { UserService } from 'jslib-common/abstractions/user.service'; @@ -32,8 +33,8 @@ export class TwoFactorAuthenticatorComponent extends TwoFactorBaseComponent impl constructor(apiService: ApiService, i18nService: I18nService, toasterService: ToasterService, private userService: UserService, - platformUtilsService: PlatformUtilsService) { - super(apiService, i18nService, toasterService, platformUtilsService); + platformUtilsService: PlatformUtilsService, logService: LogService) { + super(apiService, i18nService, toasterService, platformUtilsService, logService); this.qrScript = window.document.createElement('script'); this.qrScript.src = 'scripts/qrious.min.js'; this.qrScript.async = true; diff --git a/src/app/settings/two-factor-base.component.ts b/src/app/settings/two-factor-base.component.ts index a9fccd57..0b05d5bd 100644 --- a/src/app/settings/two-factor-base.component.ts +++ b/src/app/settings/two-factor-base.component.ts @@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { TwoFactorProviderType } from 'jslib-common/enums/twoFactorProviderType'; @@ -26,7 +27,8 @@ export abstract class TwoFactorBaseComponent { protected masterPasswordHash: string; constructor(protected apiService: ApiService, protected i18nService: I18nService, - protected toasterService: ToasterService, protected platformUtilsService: PlatformUtilsService) { } + protected toasterService: ToasterService, protected platformUtilsService: PlatformUtilsService, + protected logService: LogService) { } protected auth(authResponse: any) { this.masterPasswordHash = authResponse.masterPasswordHash; @@ -37,7 +39,9 @@ export abstract class TwoFactorBaseComponent { try { await enableFunction(); this.onUpdated.emit(true); - } catch { } + } catch (e) { + this.logService.error(e); + } } protected async disable(promise: Promise) { @@ -60,6 +64,8 @@ export abstract class TwoFactorBaseComponent { this.enabled = false; this.toasterService.popAsync('success', null, this.i18nService.t('twoStepDisabled')); this.onUpdated.emit(false); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/settings/two-factor-duo.component.ts b/src/app/settings/two-factor-duo.component.ts index 97d20117..cbcbe9c5 100644 --- a/src/app/settings/two-factor-duo.component.ts +++ b/src/app/settings/two-factor-duo.component.ts @@ -4,6 +4,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { TwoFactorProviderType } from 'jslib-common/enums/twoFactorProviderType'; @@ -24,8 +25,9 @@ export class TwoFactorDuoComponent extends TwoFactorBaseComponent { formPromise: Promise; constructor(apiService: ApiService, i18nService: I18nService, - toasterService: ToasterService, platformUtilsService: PlatformUtilsService) { - super(apiService, i18nService, toasterService, platformUtilsService); + toasterService: ToasterService, platformUtilsService: PlatformUtilsService, + logService: LogService) { + super(apiService, i18nService, toasterService, platformUtilsService, logService); } auth(authResponse: any) { diff --git a/src/app/settings/two-factor-email.component.ts b/src/app/settings/two-factor-email.component.ts index bac4e871..173ccacc 100644 --- a/src/app/settings/two-factor-email.component.ts +++ b/src/app/settings/two-factor-email.component.ts @@ -4,6 +4,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { UserService } from 'jslib-common/abstractions/user.service'; @@ -29,8 +30,8 @@ export class TwoFactorEmailComponent extends TwoFactorBaseComponent { constructor(apiService: ApiService, i18nService: I18nService, toasterService: ToasterService, platformUtilsService: PlatformUtilsService, - private userService: UserService) { - super(apiService, i18nService, toasterService, platformUtilsService); + private userService: UserService, logService: LogService) { + super(apiService, i18nService, toasterService, platformUtilsService, logService); } auth(authResponse: any) { @@ -52,7 +53,9 @@ export class TwoFactorEmailComponent extends TwoFactorBaseComponent { this.emailPromise = this.apiService.postTwoFactorEmailSetup(request); await this.emailPromise; this.sentEmail = this.email; - } catch { } + } catch (e) { + this.logService.error(e); + } } protected enable() { diff --git a/src/app/settings/two-factor-verify.component.ts b/src/app/settings/two-factor-verify.component.ts index 611c782f..9677ed43 100644 --- a/src/app/settings/two-factor-verify.component.ts +++ b/src/app/settings/two-factor-verify.component.ts @@ -12,6 +12,7 @@ import { TwoFactorProviderType } from 'jslib-common/enums/twoFactorProviderType' 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 { PasswordVerificationRequest } from 'jslib-common/models/request/passwordVerificationRequest'; @@ -30,7 +31,8 @@ export class TwoFactorVerifyComponent { private masterPasswordHash: string; constructor(private apiService: ApiService, private i18nService: I18nService, - private toasterService: ToasterService, private cryptoService: CryptoService) { } + private toasterService: ToasterService, private cryptoService: CryptoService, + private logService: LogService) { } async submit() { if (this.masterPassword == null || this.masterPassword === '') { @@ -75,6 +77,8 @@ export class TwoFactorVerifyComponent { response: response, masterPasswordHash: this.masterPasswordHash, }); - } catch { } + } catch (e) { + this.logService.error(e); + } } } diff --git a/src/app/settings/two-factor-webauthn.component.ts b/src/app/settings/two-factor-webauthn.component.ts index 95257f0c..58936e51 100644 --- a/src/app/settings/two-factor-webauthn.component.ts +++ b/src/app/settings/two-factor-webauthn.component.ts @@ -7,6 +7,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { TwoFactorProviderType } from 'jslib-common/enums/twoFactorProviderType'; @@ -39,8 +40,8 @@ export class TwoFactorWebAuthnComponent extends TwoFactorBaseComponent { constructor(apiService: ApiService, i18nService: I18nService, toasterService: ToasterService, platformUtilsService: PlatformUtilsService, - private ngZone: NgZone) { - super(apiService, i18nService, toasterService, platformUtilsService); + private ngZone: NgZone, logService: LogService) { + super(apiService, i18nService, toasterService, platformUtilsService, logService); } auth(authResponse: any) { @@ -89,7 +90,9 @@ export class TwoFactorWebAuthnComponent extends TwoFactorBaseComponent { const response = await key.removePromise; key.removePromise = null; await this.processResponse(response); - } catch { } + } catch (e) { + this.logService.error(e); + } } async readKey() { @@ -102,7 +105,9 @@ export class TwoFactorWebAuthnComponent extends TwoFactorBaseComponent { this.challengePromise = this.apiService.getTwoFactorWebAuthnChallenge(request); const challenge = await this.challengePromise; this.readDevice(challenge); - } catch { } + } catch (e) { + this.logService.error(e); + } } private readDevice(webAuthnChallenge: ChallengeResponse) { diff --git a/src/app/settings/two-factor-yubikey.component.ts b/src/app/settings/two-factor-yubikey.component.ts index f0055eca..79af2485 100644 --- a/src/app/settings/two-factor-yubikey.component.ts +++ b/src/app/settings/two-factor-yubikey.component.ts @@ -4,6 +4,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { UpdateTwoFactorYubioOtpRequest } from 'jslib-common/models/request/updateTwoFactorYubioOtpRequest'; @@ -26,8 +27,9 @@ export class TwoFactorYubiKeyComponent extends TwoFactorBaseComponent { disablePromise: Promise; constructor(apiService: ApiService, i18nService: I18nService, - toasterService: ToasterService, platformUtilsService: PlatformUtilsService) { - super(apiService, i18nService, toasterService, platformUtilsService); + toasterService: ToasterService, platformUtilsService: PlatformUtilsService, + logService: LogService) { + super(apiService, i18nService, toasterService, platformUtilsService, logService); } auth(authResponse: any) { diff --git a/src/app/settings/update-key.component.ts b/src/app/settings/update-key.component.ts index 4bb83610..a2638c4c 100644 --- a/src/app/settings/update-key.component.ts +++ b/src/app/settings/update-key.component.ts @@ -10,6 +10,7 @@ import { CipherService } from 'jslib-common/abstractions/cipher.service'; import { CryptoService } from 'jslib-common/abstractions/crypto.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 { SyncService } from 'jslib-common/abstractions/sync.service'; @@ -30,7 +31,8 @@ export class UpdateKeyComponent { constructor(private apiService: ApiService, private i18nService: I18nService, private toasterService: ToasterService, private cryptoService: CryptoService, private messagingService: MessagingService, private syncService: SyncService, - private folderService: FolderService, private cipherService: CipherService) { } + private folderService: FolderService, private cipherService: CipherService, + private logService: LogService) { } async submit() { const hasEncKey = await this.cryptoService.hasEncKey(); @@ -57,7 +59,9 @@ export class UpdateKeyComponent { }; this.toasterService.popAsync(toast); this.messagingService.send('logout'); - } catch { } + } catch (e) { + this.logService.error(e); + } } private async makeRequest(): Promise { diff --git a/src/app/settings/update-license.component.ts b/src/app/settings/update-license.component.ts index be470049..89106965 100644 --- a/src/app/settings/update-license.component.ts +++ b/src/app/settings/update-license.component.ts @@ -9,6 +9,7 @@ import { ToasterService } from 'angular2-toaster'; import { ApiService } from 'jslib-common/abstractions/api.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; @Component({ selector: 'app-update-license', @@ -22,7 +23,7 @@ export class UpdateLicenseComponent { formPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private toasterService: ToasterService) { } + private toasterService: ToasterService, private logService: LogService) { } async submit() { const fileEl = document.getElementById('file') as HTMLInputElement; @@ -51,7 +52,9 @@ export class UpdateLicenseComponent { await this.formPromise; this.toasterService.popAsync('success', null, this.i18nService.t('updatedLicense')); this.onUpdated.emit(); - } catch { } + } catch (e) { + this.logService.error(e); + } } cancel() { diff --git a/src/app/settings/user-billing.component.ts b/src/app/settings/user-billing.component.ts index 44151930..f242df00 100644 --- a/src/app/settings/user-billing.component.ts +++ b/src/app/settings/user-billing.component.ts @@ -9,6 +9,7 @@ import { BillingResponse } from 'jslib-common/models/response/billingResponse'; 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 { PaymentMethodType } from 'jslib-common/enums/paymentMethodType'; @@ -34,7 +35,8 @@ export class UserBillingComponent implements OnInit { verifyBankPromise: Promise; constructor(protected apiService: ApiService, protected i18nService: I18nService, - protected toasterService: ToasterService, protected platformUtilsService: PlatformUtilsService) { } + protected toasterService: ToasterService, protected platformUtilsService: PlatformUtilsService, + private logService: LogService) { } async ngOnInit() { await this.load(); @@ -67,7 +69,9 @@ export class UserBillingComponent implements OnInit { await this.verifyBankPromise; this.toasterService.popAsync('success', null, this.i18nService.t('verifiedBankAccount')); this.load(); - } catch { } + } catch (e) { + this.logService.error(e); + } } addCredit() { diff --git a/src/app/settings/user-subscription.component.ts b/src/app/settings/user-subscription.component.ts index a2fecbd2..5ed63db5 100644 --- a/src/app/settings/user-subscription.component.ts +++ b/src/app/settings/user-subscription.component.ts @@ -10,6 +10,7 @@ import { SubscriptionResponse } from 'jslib-common/models/response/subscriptionR 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'; @@ -31,7 +32,7 @@ export class UserSubscriptionComponent implements OnInit { constructor(private tokenService: TokenService, private apiService: ApiService, private platformUtilsService: PlatformUtilsService, private i18nService: I18nService, - private toasterService: ToasterService, private router: Router) { + private toasterService: ToasterService, private router: Router, private logService: LogService) { this.selfHosted = platformUtilsService.isSelfHost(); } @@ -78,7 +79,9 @@ export class UserSubscriptionComponent implements OnInit { await this.reinstatePromise; this.toasterService.popAsync('success', null, this.i18nService.t('reinstated')); this.load(); - } catch { } + } catch (e) { + this.logService.error(e); + } } async cancel() { @@ -103,7 +106,9 @@ export class UserSubscriptionComponent implements OnInit { await this.cancelPromise; this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription')); this.load(); - } catch { } + } catch (e) { + this.logService.error(e); + } } downloadLicense() { diff --git a/src/app/settings/verify-email.component.ts b/src/app/settings/verify-email.component.ts index 798a1cff..76d1167d 100644 --- a/src/app/settings/verify-email.component.ts +++ b/src/app/settings/verify-email.component.ts @@ -4,6 +4,7 @@ import { ToasterService } from 'angular2-toaster'; import { ApiService } from 'jslib-common/abstractions/api.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; @Component({ selector: 'app-verify-email', @@ -13,7 +14,7 @@ export class VerifyEmailComponent { actionPromise: Promise; constructor(private apiService: ApiService, private i18nService: I18nService, - private toasterService: ToasterService) { } + private toasterService: ToasterService, private logService: LogService) { } async send() { if (this.actionPromise != null) { @@ -23,7 +24,9 @@ export class VerifyEmailComponent { this.actionPromise = this.apiService.postAccountVerifyEmail(); await this.actionPromise; this.toasterService.popAsync('success', null, this.i18nService.t('checkInboxForVerification')); - } catch { } + } catch (e) { + this.logService.error(e); + } this.actionPromise = null; } } diff --git a/src/app/tools/export.component.ts b/src/app/tools/export.component.ts index 367ccfb4..b408a2cc 100644 --- a/src/app/tools/export.component.ts +++ b/src/app/tools/export.component.ts @@ -4,10 +4,11 @@ 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'; import { ExportComponent as BaseExportComponent } from 'jslib-angular/components/export.component'; -import { PolicyService } from 'jslib-common/abstractions/policy.service'; @Component({ selector: 'app-export', @@ -18,8 +19,9 @@ export class ExportComponent extends BaseExportComponent { constructor(cryptoService: CryptoService, i18nService: I18nService, platformUtilsService: PlatformUtilsService, exportService: ExportService, - eventService: EventService, policyService: PolicyService) { - super(cryptoService, i18nService, platformUtilsService, exportService, eventService, policyService, window); + eventService: EventService, policyService: PolicyService, logService: LogService) { + super(cryptoService, i18nService, platformUtilsService, exportService, eventService, + policyService, window, logService); } protected saved() { diff --git a/src/app/tools/import.component.ts b/src/app/tools/import.component.ts index 5149b977..9126c368 100644 --- a/src/app/tools/import.component.ts +++ b/src/app/tools/import.component.ts @@ -8,6 +8,7 @@ import { ToasterService } from 'angular2-toaster'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; import { ImportOption, ImportService } from 'jslib-common/abstractions/import.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'; @@ -33,7 +34,8 @@ export class ImportComponent implements OnInit { constructor(protected i18nService: I18nService, protected toasterService: ToasterService, protected importService: ImportService, protected router: Router, - protected platformUtilsService: PlatformUtilsService, protected policyService: PolicyService) { } + protected platformUtilsService: PlatformUtilsService, protected policyService: PolicyService, + private logService: LogService) { } async ngOnInit() { this.setImportOptions(); @@ -88,7 +90,9 @@ export class ImportComponent implements OnInit { if (content != null) { fileContents = content; } - } catch { } + } catch (e) { + this.logService.error(e); + } } if (fileContents == null || fileContents === '') { @@ -108,7 +112,9 @@ export class ImportComponent implements OnInit { } this.toasterService.popAsync('success', null, this.i18nService.t('importSuccess')); this.router.navigate(this.successNavigate); - } catch { } + } catch (e) { + this.logService.error(e); + } this.loading = false; } diff --git a/src/app/tools/inactive-two-factor-report.component.ts b/src/app/tools/inactive-two-factor-report.component.ts index b7a3639e..dad5f41f 100644 --- a/src/app/tools/inactive-two-factor-report.component.ts +++ b/src/app/tools/inactive-two-factor-report.component.ts @@ -4,6 +4,7 @@ import { } from '@angular/core'; import { CipherService } from 'jslib-common/abstractions/cipher.service'; +import { LogService } from 'jslib-common/abstractions/log.service'; import { MessagingService } from 'jslib-common/abstractions/messaging.service'; import { PasswordRepromptService } from 'jslib-common/abstractions/passwordReprompt.service'; import { UserService } from 'jslib-common/abstractions/user.service'; @@ -27,7 +28,8 @@ export class InactiveTwoFactorReportComponent extends CipherReportComponent impl cipherDocs = new Map(); constructor(protected cipherService: CipherService, modalService: ModalService, - messagingService: MessagingService, userService: UserService, passwordRepromptService: PasswordRepromptService) { + messagingService: MessagingService, userService: UserService, private logService: LogService, + passwordRepromptService: PasswordRepromptService) { super(modalService, userService, messagingService, passwordRepromptService, true); } @@ -40,7 +42,10 @@ export class InactiveTwoFactorReportComponent extends CipherReportComponent impl async setCiphers() { try { await this.load2fa(); - } catch { } + } catch (e) { + this.logService.error(e); + } + if (this.services.size > 0) { const allCiphers = await this.getAllCiphers(); const inactive2faCiphers: CipherView[] = []; diff --git a/src/app/vault/add-edit.component.ts b/src/app/vault/add-edit.component.ts index 5ae74338..3b817df3 100644 --- a/src/app/vault/add-edit.component.ts +++ b/src/app/vault/add-edit.component.ts @@ -9,6 +9,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 { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; @@ -44,9 +45,9 @@ export class AddEditComponent extends BaseAddEditComponent { userService: UserService, collectionService: CollectionService, protected totpService: TotpService, protected passwordGenerationService: PasswordGenerationService, protected messagingService: MessagingService, eventService: EventService, - protected policyService: PolicyService) { + protected policyService: PolicyService, logService: LogService) { super(cipherService, folderService, i18nService, platformUtilsService, auditService, stateService, - userService, collectionService, messagingService, eventService, policyService); + userService, collectionService, messagingService, eventService, policyService, logService); } async ngOnInit() { diff --git a/src/app/vault/attachments.component.ts b/src/app/vault/attachments.component.ts index a846f42b..28da5ab6 100644 --- a/src/app/vault/attachments.component.ts +++ b/src/app/vault/attachments.component.ts @@ -4,6 +4,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'; @@ -20,8 +21,10 @@ export class AttachmentsComponent extends BaseAttachmentsComponent { constructor(cipherService: CipherService, i18nService: I18nService, cryptoService: CryptoService, userService: UserService, - platformUtilsService: PlatformUtilsService, apiService: ApiService) { - super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService, window); + platformUtilsService: PlatformUtilsService, apiService: ApiService, + logService: LogService) { + super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService, window, + logService); } protected async reupload(attachment: AttachmentView) { diff --git a/src/app/vault/bulk-share.component.ts b/src/app/vault/bulk-share.component.ts index 065d57f5..21b244bf 100644 --- a/src/app/vault/bulk-share.component.ts +++ b/src/app/vault/bulk-share.component.ts @@ -11,6 +11,7 @@ import { ToasterService } from 'angular2-toaster'; 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 { UserService } from 'jslib-common/abstractions/user.service'; import { CipherView } from 'jslib-common/models/view/cipherView'; @@ -37,7 +38,7 @@ export class BulkShareComponent implements OnInit { constructor(private cipherService: CipherService, private toasterService: ToasterService, private i18nService: I18nService, private collectionService: CollectionService, - private userService: UserService) { } + private userService: UserService, private logService: LogService) { } async ngOnInit() { this.shareableCiphers = this.ciphers.filter(c => !c.hasOldAttachments && c.organizationId == null); @@ -73,7 +74,9 @@ export class BulkShareComponent implements OnInit { this.onShared.emit(); const orgName = this.organizations.find(o => o.id === this.organizationId)?.name ?? this.i18nService.t('organization'); this.toasterService.popAsync('success', null, this.i18nService.t('movedItemsToOrg', orgName)); - } catch { } + } catch (e) { + this.logService.error(e); + } } check(c: CollectionView, select?: boolean) { diff --git a/src/app/vault/ciphers.component.ts b/src/app/vault/ciphers.component.ts index 3072f147..a5cf1eff 100644 --- a/src/app/vault/ciphers.component.ts +++ b/src/app/vault/ciphers.component.ts @@ -11,6 +11,7 @@ import { ToasterService } from 'angular2-toaster'; import { CipherService } from 'jslib-common/abstractions/cipher.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 { SearchService } from 'jslib-common/abstractions/search.service'; @@ -52,7 +53,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService, protected cipherService: CipherService, protected eventService: EventService, protected totpService: TotpService, protected userService: UserService, - protected passwordRepromptService: PasswordRepromptService) { + protected passwordRepromptService: PasswordRepromptService, private logService: LogService) { super(searchService); } @@ -158,7 +159,9 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy this.toasterService.popAsync('success', null, this.i18nService.t(permanent ? 'permanentlyDeletedItem' : 'deletedItem')); this.refresh(); - } catch { } + } catch (e) { + this.logService.error(e); + } this.actionPromise = null; } @@ -179,7 +182,9 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy await this.actionPromise; this.toasterService.popAsync('success', null, this.i18nService.t('restoredItem')); this.refresh(); - } catch { } + } catch (e) { + this.logService.error(e); + } this.actionPromise = null; } diff --git a/src/app/vault/collections.component.ts b/src/app/vault/collections.component.ts index 14cca43f..853fa095 100644 --- a/src/app/vault/collections.component.ts +++ b/src/app/vault/collections.component.ts @@ -6,6 +6,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 { CollectionView } from 'jslib-common/models/view/collectionView'; @@ -18,8 +19,8 @@ import { CollectionsComponent as BaseCollectionsComponent } from 'jslib-angular/ }) export class CollectionsComponent extends BaseCollectionsComponent implements OnDestroy { constructor(collectionService: CollectionService, platformUtilsService: PlatformUtilsService, - i18nService: I18nService, cipherService: CipherService) { - super(collectionService, platformUtilsService, i18nService, cipherService); + i18nService: I18nService, cipherService: CipherService, logService: LogService) { + super(collectionService, platformUtilsService, i18nService, cipherService, logService); } ngOnDestroy() { diff --git a/src/app/vault/folder-add-edit.component.ts b/src/app/vault/folder-add-edit.component.ts index b1880c33..45d8188b 100644 --- a/src/app/vault/folder-add-edit.component.ts +++ b/src/app/vault/folder-add-edit.component.ts @@ -2,6 +2,7 @@ import { Component } from '@angular/core'; 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 { @@ -14,7 +15,7 @@ import { }) export class FolderAddEditComponent extends BaseFolderAddEditComponent { constructor(folderService: FolderService, i18nService: I18nService, - platformUtilsService: PlatformUtilsService) { - super(folderService, i18nService, platformUtilsService); + platformUtilsService: PlatformUtilsService, logService: LogService) { + super(folderService, i18nService, platformUtilsService, logService); } } diff --git a/src/app/vault/share.component.ts b/src/app/vault/share.component.ts index f67e25b5..63d0aa84 100644 --- a/src/app/vault/share.component.ts +++ b/src/app/vault/share.component.ts @@ -12,6 +12,7 @@ import { UserService } from 'jslib-common/abstractions/user.service'; import { CollectionView } from 'jslib-common/models/view/collectionView'; import { ShareComponent as BaseShareComponent } from 'jslib-angular/components/share.component'; +import { LogService } from 'jslib-common/abstractions/log.service'; @Component({ selector: 'app-vault-share', @@ -20,8 +21,9 @@ import { ShareComponent as BaseShareComponent } from 'jslib-angular/components/s export class ShareComponent extends BaseShareComponent implements OnDestroy { constructor(collectionService: CollectionService, platformUtilsService: PlatformUtilsService, i18nService: I18nService, userService: UserService, - cipherService: CipherService) { - super(collectionService, platformUtilsService, i18nService, userService, cipherService); + cipherService: CipherService, logService: LogService) { + super(collectionService, platformUtilsService, i18nService, userService, cipherService, + logService); } ngOnDestroy() { diff --git a/src/connectors/duo.ts b/src/connectors/duo.ts index 21e4b667..1c0fb8d4 100644 --- a/src/connectors/duo.ts +++ b/src/connectors/duo.ts @@ -31,5 +31,8 @@ document.addEventListener('DOMContentLoaded', event => { function invokeCSCode(data: string) { try { (window as any).invokeCSharpAction(data); - } catch (err) { } + } catch (err) { + // tslint:disable-next-line + console.log(err); + } } diff --git a/tslint.json b/tslint.json index e468a501..c087001b 100644 --- a/tslint.json +++ b/tslint.json @@ -34,7 +34,7 @@ ] } ], - "no-empty": [ true, "allow-empty-catch" ], + "no-empty": [ true ], "object-literal-sort-keys": false, "object-literal-shorthand": [ true, "never" ], "prefer-for-of": false,