mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-27 06:18:43 +01:00
Simple way to display IMAP errors:
* raise a specific exception in the imap connector, * Add a simple middleware to catch this exception and return a specific response that will be correctly displayed by the webmail. see #127
This commit is contained in:
+10
-6
@@ -49,15 +49,19 @@ function ajax_submit(event) {
|
||||
new Request({
|
||||
method: form.get("method"),
|
||||
data: data,
|
||||
onSuccess: function(responseText) {
|
||||
onSuccess: function(responseText){
|
||||
var response = JSON.decode(responseText);
|
||||
|
||||
if (response.status == "ko") {
|
||||
$(document.body).set("html", response.content);
|
||||
$(document.body).addEvent("submit", ajax_submit);
|
||||
if ($defined(error_callbacks[myid])) {
|
||||
error_callbacks[myid]();
|
||||
}
|
||||
if ($defined(response.norefresh) && response.norefresh == true) {
|
||||
$("error").set("html", response.error);
|
||||
} else {
|
||||
$(document.body).set("html", response.content);
|
||||
$(document.body).addEvent("submit", ajax_submit);
|
||||
if ($defined(error_callbacks[myid])) {
|
||||
error_callbacks[myid]();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($defined(response.ajaxnav)) {
|
||||
if ($defined(response.url)) {
|
||||
|
||||
Reference in New Issue
Block a user