| 5 | | {{{#!php |
| 6 | | <?php |
| 7 | | if( |
| 8 | | defined('WP_DEBUG') && WP_DEBUG === true && |
| 9 | | defined('WP_DEBUG_DISPLAY') && WP_DEBUG_DISPLAY === true |
| 10 | | ) { |
| 11 | | // Add current error / exception message to the JSON response. |
| 12 | | } |
| 13 | | }}} |
| 14 | | |
| 15 | | output: |
| 16 | | |
| 17 | | |
| 18 | | {{{ |
| 19 | | { |
| 20 | | "code": "internal_server_error", |
| 21 | | "message": "<p>There has been a critical error on this website.<\/p>", |
| 22 | | "data": { |
| 23 | | "status": 500, |
| 24 | | "error": "Uncaught TypeError: PluginConfig::getWpOptionStorageName(): Return value must be of type array, string returned in ..." |
| 25 | | }, |
| 26 | | "additional_errors": [] |
| 27 | | } |
| 28 | | }}} |
| 29 | | |
| 30 | | |
| | 5 | Edit: Posted and implementation example in the reply. |