CurlException.php 290 B

123456789101112131415
  1. <?php
  2. namespace Safe\Exceptions;
  3. class CurlException extends \Exception implements SafeExceptionInterface
  4. {
  5. /**
  6. * @param resource $ch
  7. */
  8. public static function createFromCurlResource($ch): self
  9. {
  10. return new self(\curl_error($ch), \curl_errno($ch));
  11. }
  12. }