We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0acd057 commit bb5baf8Copy full SHA for bb5baf8
src/Exceptions/WebRequestException.php
@@ -3,6 +3,7 @@
3
namespace WhoopsStackdriver\Exceptions;
4
5
use Exception;
6
+use Throwable;
7
8
class WebRequestException extends Exception implements ExceptionWithContext
9
{
@@ -73,4 +74,13 @@ public function setContext(array $context) : self
73
74
$this->context = $context;
75
return $this;
76
}
77
+
78
+ /**
79
+ * @param Throwable $throwable
80
+ * @return static
81
+ */
82
+ public static function wrap(Throwable $throwable) : self
83
+ {
84
+ return new static($throwable->getMessage(), $throwable->getCode(), $throwable);
85
+ }
86
0 commit comments