From 2d1d68bc7e1683bca869fcd1eca517ef209097d8 Mon Sep 17 00:00:00 2001 From: alecpl Date: Thu, 14 Oct 2010 10:37:32 +0000 Subject: - Display IMAP errors for LIST/THREAD/SEARCH commands, fixes #1486905 --- program/steps/mail/list.inc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'program/steps/mail/list.inc') diff --git a/program/steps/mail/list.inc b/program/steps/mail/list.inc index f5fc44bd4..6353be7cc 100644 --- a/program/steps/mail/list.inc +++ b/program/steps/mail/list.inc @@ -103,10 +103,17 @@ if (isset($a_headers) && count($a_headers)) if ($search_request) $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $count)); } -else if ($search_request) - $OUTPUT->show_message('searchnomatch', 'notice'); -else - $OUTPUT->show_message('nomessagesfound', 'notice'); +else { + // handle IMAP errors (e.g. #1486905) + if ($err_code = $IMAP->get_error_code()) { + $err_str = $IMAP->get_error_str(); + $OUTPUT->show_message('servererrormsg', 'error', array('msg' => $err_str)); + } + else if ($search_request) + $OUTPUT->show_message('searchnomatch', 'notice'); + else + $OUTPUT->show_message('nomessagesfound', 'notice'); +} // send response $OUTPUT->send(); -- cgit v1.2.3