Added BuildException.php

This commit is contained in:
Netkas 2022-10-22 09:03:48 -04:00
parent 98b54a0e8d
commit 9e94c6ace3
2 changed files with 36 additions and 1 deletions

View file

@ -5,6 +5,7 @@
use ncc\Exceptions\AccessDeniedException; use ncc\Exceptions\AccessDeniedException;
use ncc\Exceptions\AutoloadGeneratorException; use ncc\Exceptions\AutoloadGeneratorException;
use ncc\Exceptions\BuildConfigurationNotFoundException; use ncc\Exceptions\BuildConfigurationNotFoundException;
use ncc\Exceptions\BuildException;
use ncc\Exceptions\ComponentVersionNotFoundException; use ncc\Exceptions\ComponentVersionNotFoundException;
use ncc\Exceptions\ConstantReadonlyException; use ncc\Exceptions\ConstantReadonlyException;
use ncc\Exceptions\DirectoryNotFoundException; use ncc\Exceptions\DirectoryNotFoundException;
@ -168,6 +169,11 @@
*/ */
const UnsupportedExtensionVersionException = -1726; const UnsupportedExtensionVersionException = -1726;
/**
* @see BuildException
*/
const BuildException = -1727;
/** /**
* All the exception codes from NCC * All the exception codes from NCC
*/ */
@ -198,6 +204,7 @@
self::UnsupportedCompilerExtensionException, self::UnsupportedCompilerExtensionException,
self::InvalidPropertyValueException, self::InvalidPropertyValueException,
self::InvalidVersionConfigurationException, self::InvalidVersionConfigurationException,
self::UnsupportedExtensionVersionException self::UnsupportedExtensionVersionException,
self::BuildException
]; ];
} }

View file

@ -0,0 +1,28 @@
<?php
/** @noinspection PhpPropertyOnlyWrittenInspection */
namespace ncc\Exceptions;
use Exception;
use ncc\Abstracts\ExceptionCodes;
use Throwable;
class BuildException extends Exception
{
/**
* @var Throwable|null
*/
private ?Throwable $previous;
/**
* @param string $message
* @param Throwable|null $previous
*/
public function __construct(string $message = "", ?Throwable $previous = null)
{
parent::__construct($message, ExceptionCodes::BuildException, $previous);
$this->message = $message;
$this->previous = $previous;
}
}