New exceptions for factories.

This commit is contained in:
Alexey Skobkin 2016-03-23 22:37:19 +03:00
parent 1aacdead06
commit 8d29564d18
2 changed files with 60 additions and 0 deletions

View file

@ -0,0 +1,30 @@
<?php
namespace Skobkin\Bundle\PointToolsBundle\Service\Exceptions\Factory\Blogs;
use Exception;
use Skobkin\Bundle\PointToolsBundle\DTO\Api\Crawler\Post;
class InvalidPostDataException extends \Exception
{
/**
* @var Post
*/
private $post;
public function __construct($message = '', Post $post, $code = 0, Exception $previous = null)
{
$this->post = $post;
parent::__construct($message, $code, $previous);
}
/**
* @return Post
*/
public function getPost()
{
return $this->post;
}
}

View file

@ -0,0 +1,30 @@
<?php
namespace Skobkin\Bundle\PointToolsBundle\Service\Exceptions\Factory;
use Exception;
use Skobkin\Bundle\PointToolsBundle\DTO\Api\Crawler\User;
class InvalidUserDataException extends \Exception
{
/**
* @var User
*/
private $user;
public function __construct($message = "", User $user, $code = 0, Exception $previous = null)
{
$this->user = $user;
parent::__construct($message, $code, $previous);
}
/**
* @return User
*/
public function getUser()
{
return $this->user;
}
}