fix error message, fix #561
This commit is contained in:
parent
5d6672f379
commit
2bcac4622a
|
@ -26,15 +26,15 @@ export class NotificationService {
|
||||||
public notifyHttpError(err: HttpErrorResponse, account: AccountInfo) {
|
public notifyHttpError(err: HttpErrorResponse, account: AccountInfo) {
|
||||||
let message = 'Oops, Unknown Error';
|
let message = 'Oops, Unknown Error';
|
||||||
let code: number;
|
let code: number;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
code = err.status;
|
code = err.status;
|
||||||
if(err.message){
|
if(err.error && err.error.error) {
|
||||||
message = err.message;
|
|
||||||
} else if(err.error && err.error.error) {
|
|
||||||
message = err.error.error; //Mastodon
|
message = err.error.error; //Mastodon
|
||||||
} else if(err.error && err.error.errors && err.error.errors.detail){
|
} else if(err.error && err.error.errors && err.error.errors.detail){
|
||||||
message = err.error.errors.detail; //Pleroma
|
message = err.error.errors.detail; //Pleroma
|
||||||
|
} else if(err.message){
|
||||||
|
message = err.message;
|
||||||
}
|
}
|
||||||
} catch (err) { }
|
} catch (err) { }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue