mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
Remove empty catch blocks, and update tslint rule (#513)
This commit is contained in:
@@ -12,6 +12,7 @@ import { SendType } from 'jslib-common/enums/sendType';
|
||||
|
||||
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
||||
@@ -57,7 +58,8 @@ export class AddEditComponent implements OnInit {
|
||||
constructor(protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService,
|
||||
protected environmentService: EnvironmentService, protected datePipe: DatePipe,
|
||||
protected sendService: SendService, protected userService: UserService,
|
||||
protected messagingService: MessagingService, protected policyService: PolicyService) {
|
||||
protected messagingService: MessagingService, protected policyService: PolicyService,
|
||||
private logService: LogService) {
|
||||
this.typeOptions = [
|
||||
{ name: i18nService.t('sendTypeFile'), value: SendType.File },
|
||||
{ name: i18nService.t('sendTypeText'), value: SendType.Text },
|
||||
@@ -191,7 +193,9 @@ export class AddEditComponent implements OnInit {
|
||||
try {
|
||||
await this.formPromise;
|
||||
return true;
|
||||
} catch { }
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -218,7 +222,9 @@ export class AddEditComponent implements OnInit {
|
||||
await this.load();
|
||||
this.onDeletedSend.emit(this.send);
|
||||
return true;
|
||||
} catch { }
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
|
||||
import { OrganizationUserStatusType } from 'jslib-common/enums/organizationUserStatusType';
|
||||
import { PolicyType } from 'jslib-common/enums/policyType';
|
||||
import { SendType } from 'jslib-common/enums/sendType';
|
||||
|
||||
@@ -12,6 +11,7 @@ import { SendView } from 'jslib-common/models/view/sendView';
|
||||
|
||||
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
||||
import { SearchService } from 'jslib-common/abstractions/search.service';
|
||||
@@ -48,7 +48,8 @@ export class SendComponent implements OnInit {
|
||||
constructor(protected sendService: SendService, protected i18nService: I18nService,
|
||||
protected platformUtilsService: PlatformUtilsService, protected environmentService: EnvironmentService,
|
||||
protected ngZone: NgZone, protected searchService: SearchService,
|
||||
protected policyService: PolicyService, protected userService: UserService) { }
|
||||
protected policyService: PolicyService, protected userService: UserService,
|
||||
private logService: LogService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
this.disableSend = await this.policyService.policyAppliesToUser(PolicyType.DisableSend);
|
||||
@@ -129,7 +130,9 @@ export class SendComponent implements OnInit {
|
||||
this.platformUtilsService.showToast('success', null, this.i18nService.t('removedPassword'));
|
||||
await this.load();
|
||||
}
|
||||
} catch { }
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
this.actionPromise = null;
|
||||
}
|
||||
|
||||
@@ -156,7 +159,9 @@ export class SendComponent implements OnInit {
|
||||
this.platformUtilsService.showToast('success', null, this.i18nService.t('deletedSend'));
|
||||
await this.refresh();
|
||||
}
|
||||
} catch { }
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
this.actionPromise = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user