Aleksey Bekh-Ivanov (WMDE) has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/379823 )
Change subject: [WIP] Make ApiMessage::create throw exception if call is
inconsistent
......................................................................
[WIP] Make ApiMessage::create throw exception if call is inconsistent
Change-Id: I3ce3f8ed5ebaad9840f615f8996394d690ef3b0e
---
M includes/api/ApiMessage.php
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/23/379823/1
diff --git a/includes/api/ApiMessage.php b/includes/api/ApiMessage.php
index 9e42d5f..b1814bc 100644
--- a/includes/api/ApiMessage.php
+++ b/includes/api/ApiMessage.php
@@ -227,6 +227,10 @@
}
if ( $msg instanceof IApiMessage ) {
+ if ( $code !== null || $data !== null ) {
+ //FIXME Test it
+ throw new \LogicException( 'Error code or data
is specified but should not be' );
+ }
return $msg;
} elseif ( $msg instanceof RawMessage ) {
return new ApiRawMessage( $msg, $code, $data );
--
To view, visit https://gerrit.wikimedia.org/r/379823
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ce3f8ed5ebaad9840f615f8996394d690ef3b0e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aleksey Bekh-Ivanov (WMDE) <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits