Skip to content
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

File Format Validation and Error Handling Enhancements Solves #1456 #1471

Merged
merged 2 commits into from
Jul 19, 2023

Conversation

6ky
Copy link
Contributor

@6ky 6ky commented Jul 19, 2023

This pull request introduces enhancements to the Instagram API functions related to photo uploads, specifically photo_rupload and photo_upload. The changes are aimed at preventing potential errors and ensuring compatibility with Instagram's allowed file formats. Solving #1456

The key enhancements include:

File Format Validation: A file format validation check has been implemented in the photo_rupload function. It verifies that the provided file is in either JPG or JPEG format, which are the only formats supported by Instagram. This validation helps prevent errors during the upload process and ensures that only compatible files are processed.

Error Handling Improvement: The error handling mechanism in photo_rupload has been improved. If an invalid file format is detected, a ValueError is raised, providing a clear error message indicating that only JPG and JPEG files are allowed. This change helps users identify and rectify the issue promptly, minimizing potential confusion and troubleshooting time.

Updated photo_upload Function: The photo_upload function has been updated to utilize the enhanced photo_rupload function. The file format validation step has been integrated into photo_upload, ensuring that only valid file formats are attempted to be uploaded. By performing this check before the upload, it helps prevent errors and unsuccessful uploads due to unsupported file formats.

These changes proactively address potential errors and improve the overall reliability of the photo upload process. By validating the file format and providing clear error messages, users can avoid uploading incompatible files, thereby reducing frustration and enhancing the user experience.

Please review the changes and consider merging this pull request to improve the stability and compatibility of the Instagram API functions related to photo uploads.

@6ky 6ky mentioned this pull request Jul 19, 2023
@adw0rd adw0rd merged commit 217d88a into subzeroid:master Jul 19, 2023
4 of 8 checks passed
@adw0rd
Copy link
Contributor

adw0rd commented Jul 19, 2023

@6ky thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants