Below is an example of the error message from PHP 7 runtime:
PHP Fatal error: Uncaught Error: Class 'Predis\Connection\ConnectionException' not found in predis.php:4168
Stack trace:
#0 /var/www/api/libraries/predis/predis.php(4455): Predis\Connection\AbstractConnection->onConnectionError('Error while rea...')
Note ellipsis in the first stack trace line line marked #0:
('Error while rea...')
That's where the most important information would have been, had it not been cut off. Other error messages have the same problem, often cutting off very valuable parts of the message.
Is there a setting that we can use to print more information in stack traces? The exact version of PHP we're using is 7.1.1.
Update The exact issue we're having is described in How to disable PHP cutting off parts of long arguments in exception stack trace?. This question can be closed a dupe. The idea is to catch the exception, call Exception::getTrace() and construct the error message manually. The exception can be caught in the global hander, or in each try/catch block. The default implementation of Exception::getTraceAsString truncates long function arguments.
If you wrap the calls that might fail in a try { ... } catch (Exception $e) { ... }
block, you can display as much of the exception error messages as you wish.
You will also be able to control what you code does with the error, or helping to better avoid the issue in the future.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With