cloudinary / cloudinary/cloudinary_gem

CloudinaryException is too vague

Open
#338 3 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Ruby
Stars
420
Forks
285
PR merge metrics
No merged PRs in 30d

Description

We've seen messages like `Resource not found` and `Error in loading`, which we'd like to handle as generic HTTP client errors (400-499). Unfortunately, we have to rescue the `CloudinaryException`, check its error message, and then determine what should be done.

I would propose having more than one exception class to make it possible for us to rescue something like `Cloudinary::HttpClientError` to ignore errors like HTTP 403 (Forbidden), 404 (Not Found), 408 (Request Timeout), etc.

One way to do this would be to add `class Cloudinary::HttpClientError < CloudinaryException; end` and then use that error for the cases that represent HTTP 400-499.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.