API: Validate API error codes
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 7 Nov 2018 16:25:40 +0000 (11:25 -0500)
committerAnomie <bjorsch@wikimedia.org>
Mon, 26 Nov 2018 18:41:08 +0000 (18:41 +0000)
commit4eace785e66d199cb8fe1ec224bdc49831949a6d
tree5ee9d1fa57f0c734619b6a486050c6f9e3a976b6
parent30bd6d78e5edc60e02d42812870d369702971042
API: Validate API error codes

Validate them in ApiMessageTrait when the message is created, and again
in ApiMain before they're included in the header.

This also introduces an "api-warning" log channel, since "api" is too
spammy for real use, and converts a few existing things to use it.

Bug: T208926
Change-Id: Ib2d8bd4d4a5d58af76431835ba783c148de7792a
Depends-On: Iced44f2602d57eea9a2d15aee5b8c9a50092b49c
Depends-On: I5c2747f527c30ded7a614feb26f5777d901bd512
Depends-On: I9c9bd8f5309518fcbab7179fb71d209c005e5e64
RELEASE-NOTES-1.33
includes/api/ApiErrorFormatter.php
includes/api/ApiMain.php
includes/api/ApiMessageTrait.php
tests/phpunit/includes/api/ApiErrorFormatterTest.php
tests/phpunit/includes/api/ApiMainTest.php
tests/phpunit/includes/api/ApiMessageTest.php