kohana/core — pull request #398 by laurent22 (2013-09-07 07:49:40+00:00)
Title: Include detailed exception message when cannot read session data.

When the session data cannot be read, PHP throws an exception, which is caught by Kohana. Kohana then throws a new exception with a generic message "Error reading session data.". So, in between, the real reason why the session cannot be read has been lost.

As a fix, I suggest to simply add the PHP built-in message to the basic Kohana one. That would change this kind of errors (which I recently got in PHPunit):

Error reading session data.
Error reading session data.
Error reading session data.

to something like this:

Error reading session data. session_start(): Cannot send session cookie - headers already sent by (output started at application/tests/ControllerTest.php:2)
Error reading session data. A session had already been started - ignoring session_start()
Error reading session data. A session had already been started - ignoring session_start()