From d4132d3f56b392a2e4e632db59e6644e4851228e Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Mon, 23 Nov 2020 10:45:42 +0100 Subject: more explicit error messages for file uploads --- .../my-account-settings/my-account-settings.component.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'client/src/app/+my-account') diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts index 7ea4610d4..d5d019b35 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts @@ -1,6 +1,8 @@ import { ViewportScroller } from '@angular/common' +import { HttpErrorResponse } from '@angular/common/http' import { AfterViewChecked, Component, OnInit } from '@angular/core' import { AuthService, Notifier, User, UserService } from '@app/core' +import { uploadErrorHandler } from '@app/helpers' @Component({ selector: 'my-account-settings', @@ -44,7 +46,11 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked { this.user.updateAccountAvatar(data.avatar) }, - err => this.notifier.error(err.message) + (err: HttpErrorResponse) => uploadErrorHandler({ + err, + name: $localize`avatar`, + notifier: this.notifier + }) ) } } -- cgit v1.2.3