Fixed XML Error Output Not Particularly Useful


Well-known member
Affected version
When an expected XML response instead throws a PHP error, the existing output is not as useful as it can be for debugging. The stack trace lists files and line numbers, but the actual error that was thrown does not, so the line that has a problem is not specified. I temporarily fixed this on my test board by making the following edit to src/XF/Mvc/View.php.

                \XF\Util\Xml::createDomElement($document, 'error', $exceptionMessage)
Replace with:
            $errNode = \XF\Util\Xml::createDomElement($document, 'error', $exceptionMessage);
            $errNode->setAttribute('file', $e->getFile());
            $errNode->setAttribute('line', $e->getLine());

Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.1.8).

Change log:
Include file and line number in exception XML response
There may be a delay before changes are rolled out to the XenForo Community.
Top Bottom