-
Notifications
You must be signed in to change notification settings - Fork 53
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
Callbacks and proper error handling #13
Comments
I think that shouldn't be an error after all, just a 'warning'. |
Thank you for your suggestion. As this is not an async API, adopting the node pattern of Also, it's way easier to just throw on unrecoverable errors (like an invalid JPEG section offset) than to have error handling at every layer of the callstack. It's also easy enough to just slap a You do have a point that it should be documented that the library will throw on invalid data, I just added this to the README. |
Hmm, as @bpatrik mentioned, it probably shouldn't throw once it has already found the exif section, and just stop parsing once all information has been found. |
I agree that this module should not throw an error at all. I've used hundreds of modules but don't know any that requires a try-block somewhere. |
Hi @bwindels do you have a plan to address this? I like your proposal in #13 (comment) . |
Don't have time to work on this in the near future, sorry. Happy to review PRs though. |
I know this is 4 years old post but I just tried this library and encountered this error trying to do batch read with array that also had directory names inside. |
This module seems handy but it crashes in node.js environment:
node_modules/exif-parser/lib/jpeg.js:12
throw new Error('Invalid JPEG section offset');
^
Error: Invalid JPEG section offset
at Object.module.exports.parseSections (/home/xu/node_modules/exif-parser/lib/jpeg.js:12:11)
In node you would avoid this by using callbacks to indicate error.
The text was updated successfully, but these errors were encountered: