Bug Report #4787

Include detailed exception message when session data cannot be read

Added by Laurent Cozic about 1 year ago. Updated about 1 year ago.

Status:NewStart date:09/09/2013
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Core
Target version:-
Resolution: Points:1

Description

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()

History

#1 Updated by Laurent Cozic about 1 year ago

For information, I have already open a pull request for this:

https://github.com/kohana/core/pull/398

Also available in: Atom PDF