diff options
author | Tim Starling <tstarling@wikimedia.org> | 2019-05-09 11:36:18 +1000 |
---|---|---|
committer | Tim Starling <tstarling@wikimedia.org> | 2019-06-12 10:22:28 +1000 |
commit | 3f0056a252daa4e97396e0eb4b72651f33ce57b3 (patch) | |
tree | 406540d88dfa410c0bb8ce1bc9c8e67cc2b49ba9 /includes/Rest/HttpException.php | |
parent | 1512a0d628a0b2ba8d6146a9d5de4ab0d82bcb52 (diff) | |
download | mediawikicore-3f0056a252daa4e97396e0eb4b72651f33ce57b3.tar.gz mediawikicore-3f0056a252daa4e97396e0eb4b72651f33ce57b3.zip |
REST API initial commit
Add some of the basic REST API class hierarchies:
* EntryPoint
* Router
* Request
* Response
* Handler
The actual entry point file rest.php has been moved to a separate
commit, so this is just an unused library and service.
Bug: T221177
Change-Id: Ifca6bcb8a304e8e8b7f52b79c607bdcebf805cd1
Diffstat (limited to 'includes/Rest/HttpException.php')
-rw-r--r-- | includes/Rest/HttpException.php | 14 |
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 ); + } +} |