questlab/app/exceptions/MailingException.inc

79 lines
1.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* The Legend of Z
*
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
* @copyright 2014 Heinrich-Heine-Universität Düsseldorf
* @license http://www.gnu.org/licenses/gpl.html
* @link https://bitbucket.org/coderkun/the-legend-of-z
*/
namespace hhu\z\exceptions;
/**
* Exception during sending of an email.
*
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
*/
class MailingException extends \nre\core\Exception
{
/**
* Error code
*
* @var int
*/
const CODE = 300;
/**
* Error message
*
* @var string
*/
const MESSAGE = 'Error sending email';
/**
* Nested error message
*
* @var string
*/
private $error;
/**
* Construct a new exception.
*
* @param int $error Nested error message
* @param string $message Error message
* @param int $code Error code
*/
function __construct($error, $message=self::MESSAGE, $code=self::CODE)
{
parent::__construct(
$message,
$code,
$error
);
// Store values
$this->error = $error;
}
/**
* Get nested error message.
*
* @return string Nested error message
*/
public function getError()
{
return $this->error;
}
}
?>