| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 <?php 2 3 namespace WordPress\AiClientDependencies\Http\Discovery\Exception; 4 5 use WordPress\AiClientDependencies\Http\Discovery\Exception; 6 /** 7 * Thrown when all discovery strategies fails to find a resource. 8 * 9 * @author Tobias Nyholm <tobias.nyholm@gmail.com> 10 */ 11 final class DiscoveryFailedException extends \Exception implements Exception 12 { 13 /** 14 * @var \Exception[] 15 */ 16 private $exceptions; 17 /** 18 * @param string $message 19 * @param \Exception[] $exceptions 20 */ 21 public function __construct($message, array $exceptions = []) 22 { 23 $this->exceptions = $exceptions; 24 parent::__construct($message); 25 } 26 /** 27 * @param \Exception[] $exceptions 28 */ 29 public static function create($exceptions) 30 { 31 $message = 'Could not find resource using any discovery strategy. Find more information at http://docs.php-http.org/en/latest/discovery.html#common-errors'; 32 foreach ($exceptions as $e) { 33 $message .= "\n - " . $e->getMessage(); 34 } 35 $message .= "\n\n"; 36 return new self($message, $exceptions); 37 } 38 /** 39 * @return \Exception[] 40 */ 41 public function getExceptions() 42 { 43 return $this->exceptions; 44 } 45 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Sat Jun 13 09:38:55 2026 | Cross-referenced by PHPXref |