1<?php
2/**
3 * Exception that will be throwed when a mailbox cannot be found on the mail server.
4 */
5
6namespace GO\Base\Mail\Exception;
7
8
9use GO\Base\Mail\Imap;
10
11class MailboxNotFound extends \Exception{
12
13	public function __construct($mailbox, Imap $imap) {
14
15		$last = $imap->last_error(); // Get the last error
16
17		$message = sprintf(\GO::t("Cannot open the folder \"%s\". Please check your email account settings." . $last ),$mailbox);
18		$imap->clear_errors(); // Needed to clear the imap errors
19
20		parent::__construct($message);
21	}
22
23}
24