Model/src/Exceptions/UnhandledPropertyTypeException.php

23 lines
773 B
PHP
Raw Normal View History

2024-11-08 17:12:46 +01:00
<?php
namespace Nest\Model\Exceptions;
use Throwable;
/**
* Thrown when a property with an unhandled type has been provided.
*/
class UnhandledPropertyTypeException extends ModelException
{
/**
* @param string $propertyName Name of the provided property.
* @param class-string $propertyType Class name of the unhandled property type.
* @param int $code [optional] The Exception code.
* @param null|Throwable $previous [optional] The previous throwable used for the exception chaining.
*/
public function __construct(public readonly string $propertyName, public readonly string $propertyType, int $code = 0, ?Throwable $previous = null)
{
parent::__construct("Unhandled property $this->propertyName of type $this->propertyType.", $code, $previous);
}
}