Skip to content

Commit

Permalink
Add IncorrectValueInAttributeException
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrycze-volk committed Apr 16, 2024
1 parent 4d678b6 commit 5334f87
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/Mods/Exception/IncorrectValueInAttributeException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

/**
* Copyright (C) 2024 Saxon State and University Library Dresden
*
* This file is part of the php-mods-reader.
*
* @license GNU General Public License version 3 or later.
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*/

namespace Slub\Mods\Exception;

use Exception;
use Throwable;

class IncorrectValueInAttributeException extends Exception {

/**
* Constructor for the custom exception.
*
* @param string $attribute name of the attribute
* @param string $value not allowed value
* @param integer $code
* @param Throwable|null $previous
*
* @return void
*/
public function __construct(string $attribute, string $value, int $code = 0, Throwable $previous = null) {
$message = 'Value "' . $value . '" is not allowed for attribute "' . $attribute . '".';
parent::__construct($message, $code, $previous);
}
}

0 comments on commit 5334f87

Please sign in to comment.