‪TYPO3CMS  ‪main
TypeConverterException.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 
23 final class ‪TypeConverterException extends \TYPO3\CMS\Extbase\Property\Exception\TypeConverterException
24 {
28  protected ‪$error;
29 
31  {
32  $exception = new self(‪$error->‪getMessage(), ‪$error->‪getCode());
33  $exception->error = ‪$error;
34 
35  return $exception;
36  }
37 
38  public function ‪getError(): ‪Error
39  {
40  if (empty($this->error)) {
41  return new ‪Error($this->getMessage(), $this->getCode(), [$this->getPrevious()]);
42  }
43 
44  return ‪$this->error;
45  }
46 }
‪TYPO3\CMS\Form\Mvc\Property\Exception\TypeConverterException\getError
‪getError()
Definition: TypeConverterException.php:37
‪TYPO3\CMS\Form\Mvc\Property\Exception\TypeConverterException\fromError
‪static fromError(Error $error)
Definition: TypeConverterException.php:29
‪TYPO3\CMS\Extbase\Error\Message\getCode
‪int getCode()
Definition: Message.php:80
‪TYPO3\CMS\Form\Mvc\Property\Exception
Definition: TypeConverterException.php:16
‪TYPO3\CMS\Extbase\Error\Error
Definition: Error.php:25
‪TYPO3\CMS\Form\Mvc\Property\Exception\TypeConverterException
Definition: TypeConverterException.php:24
‪TYPO3\CMS\Extbase\Error\Message\getMessage
‪string getMessage()
Definition: Message.php:70
‪TYPO3\CMS\Form\Mvc\Property\Exception\TypeConverterException\$error
‪Error $error
Definition: TypeConverterException.php:27