fix error message, fix #561

This commit is contained in:
Nicolas Constant 2023-04-23 18:40:42 -04:00
parent 5d6672f379
commit 2bcac4622a
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 4 additions and 4 deletions

View File

@ -26,15 +26,15 @@ export class NotificationService {
public notifyHttpError(err: HttpErrorResponse, account: AccountInfo) {
let message = 'Oops, Unknown Error';
let code: number;
try {
code = err.status;
if(err.message){
message = err.message;
} else if(err.error && err.error.error) {
if(err.error && err.error.error) {
message = err.error.error; //Mastodon
} else if(err.error && err.error.errors && err.error.errors.detail){
message = err.error.errors.detail; //Pleroma
} else if(err.message){
message = err.message;
}
} catch (err) { }