Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Invalid error response for non-existent file #254
Attempting to load a non-existent file throws a fatal error instead of a League\Csv\Exception.
Standalone code, or other way to reproduce the problem
Similar to Flysystem
@nwhitt League CSV and Flysystem are two independent packages so they do not follow the same exception mechanism :) .
There's already a test to validate this output in the test suite. Are you sure about the error ? Maybe there's something else at play here
I had this exception happen because the user under which PHP was running (e.g.
I fixed it by adding the
I know it's somewhat off-topic, but this issue is the top result in Google for that error message, so maybe this will help someone.
You can reproduce this error if you have a set_error_handler() somewhere in your code.
A custom set_error_handler() emits errors, and error_get_last() returns null, hence the exception throwing not working in this line, it will generate an error:
The error easily reproducable with this code:
I think error_get_last()['message'] needs to be checked, and return a general message if its empty.