| Conditions | 6 |
| Paths | 5 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function downloadHandler(Url $parsedUrl) |
||
| 20 | { |
||
| 21 | if (str_contains($this->thrown->getMessage(), 'getaddrinfo failed')) { |
||
| 22 | throw CouldNotDownloadCertificate::hostDoesNotExist($parsedUrl->getHostName()); |
||
| 23 | } |
||
| 24 | |||
| 25 | if (str_contains($this->thrown->getMessage(), 'error:14090086')) { |
||
| 26 | throw CouldNotDownloadCertificate::noCertificateInstalled($parsedUrl->getHostName()); |
||
| 27 | } |
||
| 28 | |||
| 29 | if (str_contains($this->thrown->getMessage(), 'error:14077410') || str_contains($this->thrown->getMessage(), 'error:140770FC')) { |
||
| 30 | throw CouldNotDownloadCertificate::failedHandshake($parsedUrl); |
||
| 31 | } |
||
| 32 | |||
| 33 | if (str_contains($this->thrown->getMessage(), '(Connection timed out)')) { |
||
| 34 | throw CouldNotDownloadCertificate::connectionTimeout($parsedUrl->getTestURL()); |
||
| 35 | } |
||
| 36 | |||
| 37 | throw CouldNotDownloadCertificate::unknownError($parsedUrl->getTestURL(), $this->thrown->getMessage()); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |