CoreFiles by mySites.guru
DiscoveryFailedException.php45 lines, 1,241 bytes, from wordpress-7.2-beta3.zip
Raw History Compare with 7.2-beta2
md5
396a02feda1a50362e78d95eff087106
sha1
8bb0ddeb0725b452fa240a2fcb2779d22ac1d65c
sha256
2ecca0417088d9ac1a5f71abbcb3b81b9107972ce0188138c28076211d841905
<?php

namespace WordPress\AiClientDependencies\Http\Discovery\Exception;

use WordPress\AiClientDependencies\Http\Discovery\Exception;
/**
 * Thrown when all discovery strategies fails to find a resource.
 *
 * @author Tobias Nyholm <[email protected]>
 */
final class DiscoveryFailedException extends \Exception implements Exception
{
    /**
     * @var \Exception[]
     */
    private $exceptions;
    /**
     * @param string       $message
     * @param \Exception[] $exceptions
     */
    public function __construct($message, array $exceptions = [])
    {
        $this->exceptions = $exceptions;
        parent::__construct($message);
    }
    /**
     * @param \Exception[] $exceptions
     */
    public static function create($exceptions)
    {
        $message = 'Could not find resource using any discovery strategy. Find more information at http://docs.php-http.org/en/latest/discovery.html#common-errors';
        foreach ($exceptions as $e) {
            $message .= "\n - " . $e->getMessage();
        }
        $message .= "\n\n";
        return new self($message, $exceptions);
    }
    /**
     * @return \Exception[]
     */
    public function getExceptions()
    {
        return $this->exceptions;
    }
}

The same content is in 44 releases, WordPress 7.0-beta1 to 7.2-RC2. See them all, or every version of this file.