| 1 | <?php |
||
| 12 | final class DiscoveryFailedException extends \Exception implements Exception |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var \Exception[] |
||
| 16 | */ |
||
| 17 | private $exceptions; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param string $message |
||
| 21 | * @param \Exception[] $exceptions |
||
| 22 | */ |
||
| 23 | 6 | public function __construct($message, array $exceptions = []) |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @param \Exception[] $exceptions |
||
| 32 | */ |
||
| 33 | 6 | public static function create($exceptions) |
|
| 34 | { |
||
| 35 | 6 | $message = 'Could not find resource using any discovery strategy. Find more information at http://docs.php-http.org/en/latest/discovery.html#common-errors'; |
|
| 36 | 6 | foreach ($exceptions as $e) { |
|
| 37 | 6 | $message .= "\n - ".$e->getMessage(); |
|
| 38 | } |
||
| 39 | 6 | $message .= "\n\n"; |
|
| 40 | |||
| 41 | 6 | return new self($message, $exceptions); |
|
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return \Exception[] |
||
| 46 | */ |
||
| 47 | public function getExceptions() |
||
| 51 | } |
||
| 52 |