Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DiscoveryFailedException.php

class DiscoveryFailedException

Thrown when all discovery strategies fails to find a resource.

@author Tobias Nyholm <tobias.nyholm@gmail.com>

Hierarchy

  • interface \Http\Discovery\Exception extends \Http\Discovery\Throwable
    • class \Http\Discovery\Exception\DiscoveryFailedException extends \Http\Discovery\Exception implements \Http\Discovery\Exception

Expanded class hierarchy of DiscoveryFailedException

8 files declare their use of DiscoveryFailedException
ClassDiscovery.php in vendor/php-http/discovery/src/ClassDiscovery.php
HttpAsyncClientDiscovery.php in vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php
HttpClientDiscovery.php in vendor/php-http/discovery/src/HttpClientDiscovery.php
MessageFactoryDiscovery.php in vendor/php-http/discovery/src/MessageFactoryDiscovery.php
Psr17FactoryDiscovery.php in vendor/php-http/discovery/src/Psr17FactoryDiscovery.php

... See full list

File

vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php, line 12

Namespace

Http\Discovery\Exception
View source
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;
    }

}

Members

Title Sort descending Modifiers Object type Summary
DiscoveryFailedException::$exceptions private property
DiscoveryFailedException::create public static function
DiscoveryFailedException::getExceptions public function
DiscoveryFailedException::__construct public function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal