public static function createFromRoute(Route $route, $previous = null)
    {
        $error = (null !== $previous) ? $previous->getMessage() : null;
        $code  = (null !== $previous) ? $previous->getCode() : null;

        $message = sprintf(static::MESSAGE_FORMAT, $route->getPath());
        $message .= ' '. sprintf(static::FAILURE_MESSAGE_TITLE_FORMAT, $error);

        $exception = new static($message, $code, $previous);
        $exception->setRoute($route);

        return $exception;
    }
public static function createFromRoute(Route $route, $previous = null)
    {
        $error = (null !== $previous) ? $previous->getMessage() : null;
        $code  = (null !== $previous) ? $previous->getCode() : null;

        $message = sprintf(static::MESSAGE_FORMAT, $route->getPath());
        $message .= ' '. sprintf(static::FAILURE_MESSAGE_TITLE_FORMAT, $error);

        $exception = new static($message, $code, $previous);
        $exception->setRoute($route);

        return $exception;
    }
public static function createFromRoute ( Route $ route , $ previous = null ) { $ error = ( null !== $ previous ) ? $ previous -> getMessage ( ) : null ; $ code = ( null !== $ previous ) ? $ previous -> getCode ( ) : null ; $ message = sprintf ( static :: MESSAGE_FORMAT , $ route -> getPath ( ) ) ; $ message .= ' ' . sprintf ( static :: FAILURE_MESSAGE_TITLE_FORMAT , $ error ) ; $ exception = new static ( $ message , $ code , $ previous ) ; $ exception -> setRoute ( $ route ) ; return $ exception ; }
Create a RoutePathCompilationException from a route
and an optional previous exception

TODO: Change the `$previous` parameter to type-hint against `Throwable`
once PHP 5.x support is no longer necessary.

@param Route $route          The route that failed to compile
@param Exception|Throwable $previous   The previous exception
@return RoutePathCompilationException
Create a RoutePathCompilationException from a route and an optional previous exception