2017-08-31 11:14:21 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Exceptions;
|
|
|
|
|
|
|
|
use Exception;
|
2019-03-13 20:12:03 -07:00
|
|
|
|
2017-08-31 11:14:21 -07:00
|
|
|
class CheckoutNotAllowed extends Exception
|
|
|
|
{
|
2018-07-16 17:44:03 -07:00
|
|
|
|
|
|
|
private $errorMessage;
|
|
|
|
|
|
|
|
function __construct($errorMessage = null)
|
|
|
|
{
|
|
|
|
$this->errorMessage = $errorMessage;
|
|
|
|
|
|
|
|
parent::__construct($errorMessage);
|
|
|
|
}
|
2017-08-31 11:14:21 -07:00
|
|
|
public function __toString()
|
|
|
|
{
|
2018-07-16 17:44:03 -07:00
|
|
|
return is_null($this->errorMessage) ? "A checkout is not allowed under these circumstances" : $this->errorMessage;
|
2017-08-31 11:14:21 -07:00
|
|
|
}
|
|
|
|
}
|