fix exception not properly handled

This commit is contained in:
Nicolas Constant 2020-03-11 21:28:16 -04:00
parent d9c570a1bf
commit 2cb2e8770e
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 5 additions and 1 deletions

View File

@ -106,9 +106,11 @@ export class UserProfileComponent implements OnInit {
this.relationShipError = false;
this.toolsService.findAccount(userAccount, this.lastAccountName)
.then((account: Account) => {
if(!account) throw Error(`Could not find ${this.lastAccountName}`);
return this.getFollowStatus(userAccount, account);
})
.catch((err: HttpErrorResponse) => {
.catch((err) => {
console.error(err);
this.relationShipError = true;
})
@ -161,6 +163,8 @@ export class UserProfileComponent implements OnInit {
this.isLoading = false;
this.statusLoading = true;
if(!account) throw Error(`Could not find ${this.lastAccountName}`);
this.displayedAccount = this.fixPleromaFieldsUrl(account);
this.hasNote = account && account.note && account.note !== '<p></p>';
if (this.hasNote) {