Upload API throws RuntimeException

Open
#44 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
java
Domain
api

Research direction

Start by locating the upload method whose signature declares IOException and trace the cases that currently throw RuntimeException. The issue leaves the final error-handling design open; done requires a consistent caller-identifiable error mechanism, with its behavior documented and verified for the affected cases.

Written by the indexing model from the issue text.

Description

enhancement

Hello,

You should provide an easy way to handle upload errors in your SDK.

The method signature suggests that you will be throwing an IOException but looking at the source code, we can see that you're actually throwing RuntimeException in several cases ! These cases should be handled differently in the SDK so that the caller can identify them : they are definitely not a reason to throw a RuntimeException.

At the minimum, you should throw a IOException as specified by the upload signature.
Alternatively, you could think about a nicer error handling system, either with a custom Exception or with a specific Map returned (whose values should be documented !).

Dominant language
Java
Stars
176
Forks
113
Avg merge
9d 20h
Merged PRs (30d)
2

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudinary/cloudinary_java

All issues in cloudinary/cloudinary_java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.