notify error

This commit is contained in:
Nicolas Constant 2023-08-04 23:38:29 -04:00
parent 30f678af04
commit 8cd4d30ac8
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 5 additions and 1 deletions

View File

@ -7,6 +7,8 @@ import { LanguageService } from '../../../../services/language.service';
import { InstancesInfoService } from '../../../../services/instances-info.service'; import { InstancesInfoService } from '../../../../services/instances-info.service';
import { MastodonWrapperService } from '../../../../services/mastodon-wrapper.service'; import { MastodonWrapperService } from '../../../../services/mastodon-wrapper.service';
import { Translation } from '../../../../services/models/mastodon.interfaces'; import { Translation } from '../../../../services/models/mastodon.interfaces';
import { NotificationService } from '../../../../services/notification.service';
import { HttpErrorResponse } from '@angular/common/http';
@Component({ @Component({
selector: 'app-status-translate', selector: 'app-status-translate',
@ -31,6 +33,7 @@ export class StatusTranslateComponent implements OnInit, OnDestroy {
private readonly mastodonWrapperService: MastodonWrapperService, private readonly mastodonWrapperService: MastodonWrapperService,
private readonly languageService: LanguageService, private readonly languageService: LanguageService,
private readonly instancesInfoService: InstancesInfoService, private readonly instancesInfoService: InstancesInfoService,
private readonly notificationService: NotificationService
) { } ) { }
ngOnInit() { ngOnInit() {
@ -82,8 +85,9 @@ export class StatusTranslateComponent implements OnInit, OnDestroy {
this.translatedBy = x.provider; this.translatedBy = x.provider;
this.isTranslationAvailable = false; this.isTranslationAvailable = false;
}) })
.catch(err => { .catch((err: HttpErrorResponse) => {
console.error(err); console.error(err);
this.notificationService.notifyHttpError(err, this.status.provider);
}); });
return false; return false;
} }