2021-02-26 16:16:17 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
namespace Safe\Exceptions;
|
|
|
|
|
|
|
|
class CurlException extends \Exception implements SafeExceptionInterface
|
|
|
|
{
|
|
|
|
/**
|
2022-07-12 19:26:21 +00:00
|
|
|
* @param \CurlHandle $ch
|
2021-02-26 16:16:17 +00:00
|
|
|
*/
|
2022-07-31 10:55:09 +00:00
|
|
|
public static function createFromPhpError($ch = null): self
|
2021-02-26 16:16:17 +00:00
|
|
|
{
|
2022-07-31 10:55:09 +00:00
|
|
|
return new self($ch ? \curl_error($ch) : '', $ch ? \curl_errno($ch) : 0);
|
2021-02-26 16:16:17 +00:00
|
|
|
}
|
|
|
|
}
|