mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Pass api error message through to toast notification when creating new user
This commit is contained in:
parent
9d7532ceab
commit
9138734520
1 changed files with 11 additions and 3 deletions
|
@ -148,9 +148,17 @@ const UserNew = () => {
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error('[usernew] failed to update user policy', err);
|
console.error('[usernew] failed to update user policy', err);
|
||||||
});
|
});
|
||||||
}, function () {
|
}, function (error) {
|
||||||
|
try {
|
||||||
|
console.error('[usernew] failed to create new user', error);
|
||||||
|
error.text().then((errorMessage: string) => {
|
||||||
|
toast(errorMessage);
|
||||||
|
loading.hide();
|
||||||
|
});
|
||||||
|
} catch {
|
||||||
toast(globalize.translate('ErrorDefault'));
|
toast(globalize.translate('ErrorDefault'));
|
||||||
loading.hide();
|
loading.hide();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue