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