imap icon indicating copy to clipboard operation
imap copied to clipboard

Improve error details

Open pupaxxo opened this issue 6 years ago • 1 comments

Hi,

in Ddeboer\Imap\Mailbox::getMessageSequence if any error happens you throw an InvalidSearchCriteriaException with "invalid sequence [...]" message. The error you receive is not always this. You have imap_last_error, you could return an exception with the last_error message.

            if (false !== $errorMessage = \imap_last_error()) {
                throw new InvalidSearchCriteriaException($errorMessage ?: \sprintf('Invalid sequence [%s]', $sequence));
            }

Something like ^ could work

pupaxxo avatar Dec 16 '19 16:12 pupaxxo

A PR would be welcome

Slamdunk avatar Dec 17 '19 08:12 Slamdunk