• Модуль: mail
  • Путь к файлу: ~/bitrix/modules/mail/lib/imap.php
  • Класс: BitrixMailImap
  • Вызов: Imap::errorMessage
protected function errorMessage($errors, $details = null)
{
	$errors  = array_filter((array) $errors);
	$details = array_filter((array) $details);

	foreach ($errors as $i => $error)
	{
		$errors[$i] = static::decodeError($error);
		$this->errors->setError(new MainError((string) $errors[$i], $error > 0 ? $error : 0));
	}

	$error = join(': ', $errors);
	if ($details)
	{
		$error .= sprintf(' (IMAP: %s)', join(': ', $details));

		$this->errors->setError(new MainError('IMAP', -1));
		foreach ($details as $item)
		{
			$this->errors->setError(new MainError((string) $item, -1));
		}
	}

	return $error;
}