From c765b4e37cfb39ca41ece6e47c43885fd79d6454 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 26 Nov 2018 13:31:41 -0500 Subject: API: Add exception class as data to internal_api_error codes The code for all uncaught exceptions will in the future be "internal_api_error". If the client needs to know the class name for some reason, it can check the new 'errorclass' data item on the error. Change-Id: Ia9e32bbb8d17692203f4fbcee53a20e87be1776e --- tests/phpunit/includes/api/ApiErrorFormatterTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/phpunit/includes/api/ApiErrorFormatterTest.php') diff --git a/tests/phpunit/includes/api/ApiErrorFormatterTest.php b/tests/phpunit/includes/api/ApiErrorFormatterTest.php index 65a511d85bec..312ef55e8fa4 100644 --- a/tests/phpunit/includes/api/ApiErrorFormatterTest.php +++ b/tests/phpunit/includes/api/ApiErrorFormatterTest.php @@ -599,7 +599,9 @@ class ApiErrorFormatterTest extends MediaWikiLangTestCase { [ 'text' => '<b>Something broke!</b>', 'code' => 'internal_api_error_RuntimeException', - 'data' => [], + 'data' => [ + 'errorclass' => 'RuntimeException', + ], ] ], 'Normal exception, wrapped' => [ -- cgit v1.2.3