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

Error handling when the folder type is not dynamic folder #398

Closed
wants to merge 4 commits into from

Conversation

someshfengde
Copy link

Brief Summary of Changes

added exception for directing user to dashboard to check the folder type in case error

What does this PR address?

Are tests included?

  • Yes
  • No

Reviewer, please note:

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I ran the full test suite before pushing the changes and all the tests pass.

main.py Outdated
cloudinary.config(
cloud_name = "dfxefh712",
api_key = "936813184334185",
api_secret = "w6SdsGJqrm34jlKZuzvKQqHES4o", # Click 'View API Keys' above to copy your API secret
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@someshfengde please remove your secret from this file, since everyone can see it and it is already compromised.

You can disable existing and generate a new one here:
https://console.cloudinary.com/settings/api-keys

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry removed the main.py file and disabled the secret

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for informing


try:
result = json.loads(body.decode('utf-8'))
except Exception as e:
# Error is parsing json
raise GeneralError("Error parsing server response (%d) - %s. Got - %s" % (response.status, body, e))
raise GeneralError("API is only supported on dynamic folders please check your folder mode on https://console.cloudinary.com/pm/developer-dashboard Error:%s " % str(e))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There can be different reasons to get a general error, not related to dynamic folders, this message will be misleading in all other use cases. We will open an issue for our backend team, the correct error should come back from our servers.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh got it. Should I make any changes or wait?

thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@someshfengde you can close this PR, since it's not related to the SDK.
@tommyg-cld will pass the issue to the backend team.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks,

got it :)

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