Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
get_image api added #672
get_image api added #672
Changes from 2 commits
2da17be
428ee0a
67a24e1
51b1256
5891c4c
aedfc79
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
open_image
function lacks error handling for specific exceptions, such asHTTPError
for URL issues orFileNotFoundError
for local file issues. This can help provide more detailed logs for troubleshooting.Committable suggestion
The function
open_image
uses a broadException
catch which might suppress unexpected errors, making debugging harder. It's better to catch specific exceptions.Consider catching specific exceptions such as
IOError
for file access issues andurllib.error.URLError
for URL problems, to provide more targeted error handling and logging.The logging within
open_image
uses a generic message for both successful openings and failures. It would be beneficial to differentiate between opening a local file and downloading an image from a URL for clearer logs.Committable suggestion