[fix] Correctly handle error 500 (#166)

* [fix] Correctly handle error 500
* [fix] Use 'em' instead of 'emph'
This commit is contained in:
Alexandre Aubin 2017-07-27 16:30:15 +02:00 committed by GitHub
parent 9fbae57aff
commit 382b81a664
2 changed files with 8 additions and 1 deletions

View file

@ -133,6 +133,13 @@
c.redirect('#/login'); c.redirect('#/login');
} }
} }
// 500
else if (xhr.status == 500) {
error_log = JSON.parse(xhr.responseText);
error_log.route = error_log.route.join(' ') + '\n';
error_log.arguments = JSON.stringify(error_log.arguments);
c.flash('fail', y18n.t('internal_exception', [error_log.route, error_log.arguments, error_log.traceback]));
}
// 502 Bad gateway means API is down // 502 Bad gateway means API is down
else if (xhr.status == 502) { else if (xhr.status == 502) {
c.flash('fail', y18n.t('api_not_responding')); c.flash('fail', y18n.t('api_not_responding'));

View file

@ -159,6 +159,7 @@
"installed_apps": "Installed apps", "installed_apps": "Installed apps",
"installing": "Installing", "installing": "Installing",
"interface": "Interface", "interface": "Interface",
"internal_exception": "<strong>Yunohost encountered an internal error :/</strong><br><em>Really sorry about that.<br>You should look for help on <a href=\"https://forum.yunohost.org/\">the forum</a> or <a href=\"https://chat.yunohost.org/\">the chat</a> to fix the situation, or report the bug on <a href=\"https://dev.yunohost.org/projects/yunohost/issues\">the bugtracker</a>.</em><br>The following information might be useful for the person helping you :<h3>Action</h3><pre>%s%s</pre><h3>Traceback</h3><pre>%s</pre>",
"io": "I/O", "io": "I/O",
"ipv4": "IPv4", "ipv4": "IPv4",
"ipv6": "IPv6", "ipv6": "IPv6",
@ -345,4 +346,3 @@
"install_community_appslists_warning" : "Note that these applications packages are <strong>not</strong> official and not maintained by the YunoHost team.<br />Installing these applications is at your own risk and could break your system.", "install_community_appslists_warning" : "Note that these applications packages are <strong>not</strong> official and not maintained by the YunoHost team.<br />Installing these applications is at your own risk and could break your system.",
"install_custom_app_appslists_info" : "Note that you can use alternative applications lists to install some other apps maintained by the YunoHost community." "install_custom_app_appslists_info" : "Note that you can use alternative applications lists to install some other apps maintained by the YunoHost community."
} }