Gergő Tisza has uploaded a new change for review.
https://gerrit.wikimedia.org/r/213599
Change subject: Generate errors via an API call
......................................................................
Generate errors via an API call
Bug: T100140
Change-Id: Iadc8544da8c780b6051a879f06e100a042e0f802
---
A ApiBuggy.php
M Buggy.php
M extension.json
M i18n/en.json
M i18n/qqq.json
5 files changed, 19 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Buggy
refs/changes/99/213599/1
diff --git a/ApiBuggy.php b/ApiBuggy.php
new file mode 100644
index 0000000..f26b1e0
--- /dev/null
+++ b/ApiBuggy.php
@@ -0,0 +1,7 @@
+<?php
+
+class ApiBuggy extends ApiBase {
+ public function execute() {
+ throw new Exception( 'Buggy test exception via API' );
+ }
+}
diff --git a/Buggy.php b/Buggy.php
index 3d18174..beb7f13 100644
--- a/Buggy.php
+++ b/Buggy.php
@@ -46,11 +46,14 @@
// Register files
$wgAutoloadClasses['BuggyHooks'] = __DIR__ . '/Buggy.hooks.php';
+$wgAutoloadClasses['ApiBuggy'] = __DIR__ . '/ApiBuggy.php';
$wgMessagesDirs['BoilerPlate'] = __DIR__ . '/i18n';
// Register hooks
$wgHooks['BeforePageDisplay'][] = 'BuggyHooks::onBeforePageDisplay';
+$wgAPIModules['buggy'] = 'ApiBuggy';
+
// Register modules
$wgBuggyPaths = array(
'localBasePath' => __DIR__,
diff --git a/extension.json b/extension.json
index c3ef82f..153ded4 100644
--- a/extension.json
+++ b/extension.json
@@ -12,6 +12,9 @@
"BuggyHooks::onBeforePageDisplay"
]
},
+ "APIModules": {
+ "buggy": "ApiBuggy"
+ },
"MessagesDirs": {
"BoilerPlate": [
"i18n"
@@ -65,7 +68,8 @@
}
},
"AutoloadClasses": {
- "BuggyHooks": "Buggy.hooks.php"
+ "BuggyHooks": "Buggy.hooks.php",
+ "ApiBuggy": "ApiBuggy.php"
},
"config": {
"BuggyPaths": {
diff --git a/i18n/en.json b/i18n/en.json
index a654024..15e5b4a 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -2,5 +2,6 @@
"@metadata": {
"authors": []
},
- "buggy-desc": "This extension is intentionally buggy. It is used to
test error handling."
+ "buggy-desc": "This extension is intentionally buggy. It is used to
test error handling.",
+ "apihelp-buggy-description": "Calling this API action will result in an
exception."
}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 7e598cd..86bc08f 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -2,5 +2,6 @@
"@metadata": {
"authors": []
},
- "buggy-desc":
"{{desc|name=Buggy|url=http://www.mediawiki.org/wiki/Extension:Buggy}}"
+ "buggy-desc":
"{{desc|name=Buggy|url=http://www.mediawiki.org/wiki/Extension:Buggy}}",
+ "apihelp-buggy-description": "{{doc-apihelp-description||buggy|buggy}}"
}
--
To view, visit https://gerrit.wikimedia.org/r/213599
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iadc8544da8c780b6051a879f06e100a042e0f802
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Buggy
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits