-
-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid error response for non-existent file #254
Comments
@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 |
It must be in the error handling of my symfony package with suppression, as I get green on unit tests. I'll close this issue until I have more information. |
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: Lines 177 to 178 in 6418c1c
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. |
Good catch this is a easy fix. I'll try to release a patch this week or the next one... or you can submit a PR with the fix if you want |
Issue summary
Attempting to load a non-existent file throws a fatal error instead of a League\Csv\Exception.
System informations
Standalone code, or other way to reproduce the problem
Reader::createFromPath('/does/not/exist.csv');
Expected result
Similar to Flysystem
Actual result
The text was updated successfully, but these errors were encountered: