Allow message exception to signal message controller to return an HTTP status code
[gitphp.git] / include / MessageException.class.php
blob:a/include/MessageException.class.php -> blob:b/include/MessageException.class.php
--- a/include/MessageException.class.php
+++ b/include/MessageException.class.php
@@ -18,6 +18,8 @@
 {
 
 	public $Error;
+
+	public $StatusCode;
 	
 	/**
 	 * Constructor
@@ -25,12 +27,14 @@
 	 * @access public
 	 * @param string $message message string
 	 * @param boolean $error true if this is an error rather than informational
+	 * @param integer $statusCode HTTP status code to return
 	 * @param integer $code exception code
 	 * @param Exception $previous previous exception
 	 * @return Exception message exception object
 	 */
-	public function __construct($message, $error = false, $code = 0) {
+	public function __construct($message, $error = false, $statusCode = 200, $code = 0) {
 		$this->Error = $error;
+		$this->StatusCode = $statusCode;
 		parent::__construct($message, $code);
 	}
 }

comments