Full implemantation
This commit is contained in:
@ -1,14 +1,15 @@
|
||||
<?php
|
||||
namespace ProVM\Common\Exception;
|
||||
|
||||
use Ddeboer\Imap\MailboxInterface;
|
||||
use Exception;
|
||||
|
||||
class EmptyMailbox extends Exception
|
||||
{
|
||||
public function __construct(?Throwable $previous = null)
|
||||
public function __construct(MailboxInterface $mailbox, ?Throwable $previous = null)
|
||||
{
|
||||
$message = "No mails found";
|
||||
$code = 102;
|
||||
$message = "No mails found in {$mailbox->getName()}";
|
||||
$code = 101;
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
}
|
@ -5,9 +5,9 @@ use Exception;
|
||||
|
||||
class Invalid extends Exception
|
||||
{
|
||||
public function __construct(?Throwable $previous = null)
|
||||
public function __construct(string $mailbox_name, ?Throwable $previous = null)
|
||||
{
|
||||
$message = "Mailbox not found";
|
||||
$message = "Mailbox {$mailbox_name} not found";
|
||||
$code = 100;
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
15
api/common/Exception/Mailbox/Stateless.php
Normal file
15
api/common/Exception/Mailbox/Stateless.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace ProVM\Common\Exception\Mailbox;
|
||||
|
||||
use Exception;
|
||||
use ProVM\Emails\Model\Mailbox;
|
||||
|
||||
class Stateless extends Exception
|
||||
{
|
||||
public function __construct(Mailbox $mailbox, ?Throwable $previous = null)
|
||||
{
|
||||
$message = "Mailbox {$mailbox->getName()} has not loaded any emails.";
|
||||
$code = 102;
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user