mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[fix] Display responseText on API error. #171
This commit is contained in:
parent
8e1e76ea44
commit
978cf6eee7
2 changed files with 7 additions and 2 deletions
2
src/dist/js/script.min.js
vendored
2
src/dist/js/script.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -105,7 +105,12 @@
|
||||||
} else if (typeof xhr.responseJSON !== 'undefined') {
|
} else if (typeof xhr.responseJSON !== 'undefined') {
|
||||||
c.flash('fail', xhr.responseJSON.error);
|
c.flash('fail', xhr.responseJSON.error);
|
||||||
} else if (typeof xhr.statusText !== 'undefined' && uri !== '/postinstall') {
|
} else if (typeof xhr.statusText !== 'undefined' && uri !== '/postinstall') {
|
||||||
c.flash('fail', y18n.t('api_not_responding', [xhr.status+' '+xhr.statusText]));
|
var errorMessage = xhr.status+' '+xhr.statusText;
|
||||||
|
// If some more text is available, display it to user.
|
||||||
|
if (typeof xhr.responseText !== 'undefined') {
|
||||||
|
errorMessage += ' - ' + xhr.responseText;
|
||||||
|
}
|
||||||
|
c.flash('fail', y18n.t('api_not_responding', [errorMessage]));
|
||||||
} else {
|
} else {
|
||||||
if (uri === '/postinstall') {
|
if (uri === '/postinstall') {
|
||||||
if (installing) {
|
if (installing) {
|
||||||
|
|
Loading…
Reference in a new issue