From 8cd4d30ac8fcec5a51ab0bf383b33de8ede7be00 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Fri, 4 Aug 2023 23:38:29 -0400 Subject: [PATCH] notify error --- .../status/status-translate/status-translate.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/components/stream/status/status-translate/status-translate.component.ts b/src/app/components/stream/status/status-translate/status-translate.component.ts index fd9f1c84..0d1db41c 100644 --- a/src/app/components/stream/status/status-translate/status-translate.component.ts +++ b/src/app/components/stream/status/status-translate/status-translate.component.ts @@ -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; }