Rechaza este input

@param \Throwable $exception

@return \PlanB\DS\Resolver\Input
176705
public function throws(\Throwable $exception): self
    {
        $this->exception = $exception;
        $this->invalidate();

        return $this;
    }
1018882
public function transform(Exception $exception)
    {
        if ($exception instanceof TokenMismatchException) {
            $exception = new BadRequestHttpException($exception->getMessage() ?: 'CSRF token validation failed.', $exception, $exception->getCode());
        }

        return $exception;
    }
281961
public function throwServiceException(\Throwable $exception)
    {
        $exceptionClass = ExceptionInterface::class;

        if (method_exists($exception, 'getFaultCode')) {
            $exceptionClass = $this->getServiceException($exception->getFaultCode());
        }
        if ($exceptionClass !== ExceptionInterface::class) {
            throw new $exceptionClass($exception->getMessage());
        }

        throw new ServerException('Unknown error occurred', 0, $exception);
    }
358682
protected function handleError($exception){
        $error = $this->queryBuilder->handleQueryException($exception);
        if($error[0] && isset($this->translations[$this->name][$error[0].'_'.$error[1]])) {
            $message = $this->translations[$this->name][$error[0].'_'.$error[1]];
        } else {
            $message = sprintf($this->translations['database']['query_error'],$error[0], $error[1]);
        }
        return $message;
    }
300190
protected function extractExceptionProperties(\Throwable $exception): array
    {
        $previous = $exception->getPrevious();

        return [
            '$message' => $exception->getMessage(),
            '$file' => $exception->getFile(),
            '$code' => $exception->getCode(),
            '$line' => $exception->getLine(),
            '$previous' => $previous ? $this->extractExceptionProperties($previous) : null,
        ];
    }
42033
public static function exceptionToResponse(\Throwable $exception): ResponseInterface
    {
        self::$reserved = null;

        if ($exception instanceof HttpErrorException) {
            $statusCode = $exception->getCode();
        } else {
            $userAgent = self::$request->getHeaderLine('User-Agent');
            $statusCode = $userAgent && \strpos($userAgent, 'MSIE ') !== false ? 503 : 500;
        }

        $headers = [];
        $template = 'html';
        $isHtmlMode = false;

        $accept = self::$request->getHeaderLine('Accept');
        foreach (static::$handlers as $template => $types) {
            foreach ($types as $type) {
                if (\stripos($accept, $type) !== false) {
                    $headers['Content-Type'] = $type;
                    break 2;
                }
            }
        }

        if ($headers === []) {
            $isHtmlMode = Helpers::isHtmlMode();

            if ($isHtmlMode) {
                $template = '500';
                $headers['Content-Type'] = 'text/html; charset=UTF-8';
            }
        }

        Helpers::improveException($exception);
        self::removeOutputBuffers(true);

        if (self::isProductionMode()) {
            try {
                self::log($exception, self::getExceptionLevel($exception));
            } catch (\Throwable $e) {
            }

            $body = self::exceptionTemplate($template, $exception, empty($e));
        } elseif ($isHtmlMode || Helpers::isAjax()) {
            $body = self::getBlueScreen()->render($exception);
        } else {
            $level = self::getExceptionLevel($exception);
            self::chromeLog($exception, $level);

            $s = Helpers::getClass($exception) . ($exception->getMessage() === '' ? '' : ': ' . $exception->getMessage())
                . ' in ' . $exception->getFile() . ':' . $exception->getLine()
                . "\nStack trace:\n" . $exception->getTraceAsString();
            try {
                $file = self::log($exception, $level);
                if ($file) {
                    $headers['X-Tracy-Error-Log'] = $file;
                }

                $body = "$s\n" . ($file ? "(stored in $file)\n" : '');
            } catch (\Throwable $e) {
                $body = "$s\nUnable to log error: {$e->getMessage()}\n";
            }
        }

        return self::writeToResponse(
            Factory::response($statusCode, $body, $headers)
        );
    }
1290047
public function setException(Exception $exception)
    {
        $this->exception = $exception;
        return $this->raiseStatus(self::Status_Exception);
    }
567699
protected function getTransformed(Exception $exception)
    {
        foreach ($this->make((array) $this->getConfigItem('transformers')) as $transformer) {
            $exception = $transformer->transform($exception);
        }

        return $exception;
    }
874689
public static function fromException(\Exception $e): self
    {
        return new self($e->getMessage(), $e->getCode(), $e);
    }
882355
protected function getClass(\Exception $exception)
    {
        $message = '';

        if (($previous = $exception->getPrevious())) {
            $message = $this->getClass($previous) . ' < '; // Recurse
        }

        // Let the exception lie about its class: to support marshalling exceptions
        if (method_exists($exception, 'getClass')) {
            $message .= $exception->getClass();
        } else {
            $message .= get_class($exception);
        }

        return $message;
    }
145065
protected function renderSingleExceptionCli(\Throwable $exception): string
    {
        $exceptionMessageParts = $this->splitExceptionMessage($exception->getMessage());
        $exceptionMessage = '<error><b>' . $exceptionMessageParts['subject'] . '</b></error>' . PHP_EOL;
        if ($exceptionMessageParts['body'] !== '') {
            $exceptionMessage .= wordwrap($exceptionMessageParts['body'], 73, PHP_EOL) . PHP_EOL;
        }

        $exceptionMessage .= PHP_EOL;
        $exceptionMessage .= $this->renderExceptionDetailCli('Type', get_class($exception));
        if ($exception->getCode()) {
            $exceptionMessage .= $this->renderExceptionDetailCli('Code', $exception->getCode());
        }
        $exceptionMessage .= $this->renderExceptionDetailCli('File', str_replace(FLOW_PATH_ROOT, '', $exception->getFile()));
        $exceptionMessage .= $this->renderExceptionDetailCli('Line', $exception->getLine());

        return $exceptionMessage;
    }
193019
public static function assertIsReadable(string $path, Throwable $exception): string
    {
        static::makeAssertion(\is_readable($path), $exception);
        return $path;
    }
1276464
protected function requestExceptionHandler(Throwable $exception) : ?Throwable
    {
        if ($exception instanceof RequestException) {
            if (
                $exception->hasResponse() &&
                $exception->getResponse()->hasError()
            ) {
                return new BadRemoteCallException($exception->getResponse());
            }

            return new ConnectionException(
                $exception->getRequest(),
                $exception->getMessage(),
                $exception->getCode()
            );
        }

        return null;
    }
14086
public function resolve(Exception $exception)
	{
		if($abettor = $this->getAbettor($exception))
		{
			return new $abettor;
		}

		return $this->handler;
	}
1071082
private function serializeException(\Exception $exception)
    {
        $result = [
            'code'    => $exception->getCode(),
            'message' => $exception->getMessage(),
            'file'    => $exception->getFile(),
            'line'    => $exception->getLine(),
            'trace'   => $exception->getTraceAsString(),
        ];

        if ($exception->getPrevious() !== null) {
            $result['previous'] = $this->serializeException($exception->getPrevious());
        }

        return $result;
    }
991973
public function handleException($exception)
	{
		if (is_object($this->logger) && !in_array($exception->getCode(), [403, 404]))
		{
			$this->logger->log(
				'error',
				$exception->getMessage(),
				array(
					'code' => $exception->getCode(),
					'file' => $exception->getFile(),
					'line' => $exception->getLine()
				)
			);
		}

		return $this->renderer->render($exception);
	}
455858
public function fromException( Exception $exception )
    {
        return $this->generateResponse(
            xmlrpc_encode_request(
                null,
                array(
                    'faultCode' => $exception->getCode(),
                    'faultString' => $exception->getMessage()
                )
            )
        );
    }