imap : if there is an authentication, return an exception with 401 code

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2376 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2015-10-23 12:53:51 +00:00
parent 64c1130fa7
commit 67b1d771ac

View File

@@ -63,6 +63,9 @@ class imap
{
// imap_errors() takes the errors and clear the error stack
$errors = imap_errors();
if (substr ($e->getMessage (), 0, 35) ===
"Can not authenticate to IMAP server")
throw new Exception ("IMAP error : ".$e->getMessage(), 401);
throw new Exception ("IMAP error : ".$e->getMessage(), 500);
}
}