public function __construct($type, Exception $cause = null)
{
$this->type = $type;
if (is_string($type)) {
$message = sprintf('Undefined type %s.', var_export($type, true));
} else {
$message = sprintf('Unable to add type of type %s.', var_export(gettype($type), true));
}
parent::__construct($message, 0, $cause);
}