aboutsummaryrefslogtreecommitdiffstats
path: root/includes/Rest/HttpException.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/Rest/HttpException.php')
-rw-r--r--includes/Rest/HttpException.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/includes/Rest/HttpException.php b/includes/Rest/HttpException.php
new file mode 100644
index 000000000000..ae6dde2b3f4f
--- /dev/null
+++ b/includes/Rest/HttpException.php
@@ -0,0 +1,14 @@
+<?php
+
+namespace MediaWiki\Rest;
+
+/**
+ * This is the base exception class for non-fatal exceptions thrown from REST
+ * handlers. The exception is not logged, it is merely converted to an
+ * error response.
+ */
+class HttpException extends \Exception {
+ public function __construct( $message, $code = 500 ) {
+ parent::__construct( $message, $code );
+ }
+}