wp/wp-includes/Requests/Exception.php
changeset 7 cf61fcea0001
child 18 be944660c56a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wp/wp-includes/Requests/Exception.php	Mon Oct 14 17:39:30 2019 +0200
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Exception for HTTP requests
+ *
+ * @package Requests
+ */
+
+/**
+ * Exception for HTTP requests
+ *
+ * @package Requests
+ */
+class Requests_Exception extends Exception {
+	/**
+	 * Type of exception
+	 *
+	 * @var string
+	 */
+	protected $type;
+
+	/**
+	 * Data associated with the exception
+	 *
+	 * @var mixed
+	 */
+	protected $data;
+
+	/**
+	 * Create a new exception
+	 *
+	 * @param string $message Exception message
+	 * @param string $type Exception type
+	 * @param mixed $data Associated data
+	 * @param integer $code Exception numerical code, if applicable
+	 */
+	public function __construct($message, $type, $data = null, $code = 0) {
+		parent::__construct($message, $code);
+
+		$this->type = $type;
+		$this->data = $data;
+	}
+
+	/**
+	 * Like {@see getCode()}, but a string code.
+	 *
+	 * @codeCoverageIgnore
+	 * @return string
+	 */
+	public function getType() {
+		return $this->type;
+	}
+
+	/**
+	 * Gives any relevant data
+	 *
+	 * @codeCoverageIgnore
+	 * @return mixed
+	 */
+	public function getData() {
+		return $this->data;
+	}
+}
\ No newline at end of file