imap
imap copied to clipboard
Improve error details
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
A PR would be welcome