summaryrefslogtreecommitdiff
path: root/vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php')
-rw-r--r--vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php b/vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php
new file mode 100644
index 000000000..2814066b0
--- /dev/null
+++ b/vendor/thecodingmachine/safe/lib/Exceptions/CurlException.php
@@ -0,0 +1,15 @@
+<?php
+
+
+namespace Safe\Exceptions;
+
+class CurlException extends \Exception implements SafeExceptionInterface
+{
+ /**
+ * @param resource $ch
+ */
+ public static function createFromCurlResource($ch): self
+ {
+ return new self(\curl_error($ch), \curl_errno($ch));
+ }
+}