XBackBone/app/Exceptions/ValidationException.php

31 lines
575 B
PHP
Raw Normal View History

2020-03-02 18:16:11 +00:00
<?php
namespace App\Exceptions;
use Exception;
use Psr\Http\Message\ResponseInterface as Response;
use Throwable;
class ValidationException extends Exception
{
/**
* @var Response
*/
private $response;
2020-04-10 14:45:43 +00:00
public function __construct(Response $response, $message = "", Throwable $previous = null)
2020-03-02 18:16:11 +00:00
{
parent::__construct($message, $response->getStatusCode(), $previous);
$this->response = $response;
}
/**
* @return Response
*/
public function response(): Response
{
return $this->response;
}
}