GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Upload API throws RuntimeException · Issue #44 · cloudinary/cloudinary_java

Upload API throws RuntimeException #44

New issue
Copy link
New issue
Copy link
Open
Open
Upload API throws RuntimeException#44
Copy link
Labels
enhancement

Description

@JulienArzul
JulienArzul
opened on May 2, 2016
Issue body actions

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 !).

Activity

  1. tocker commented on May 18, 2016

    @tocker
    tocker
    on May 18, 2016
    Contributor
    More actions

    Hi @JulienArzul,
    You may have a point here however we cannot change the exception to IOException without changing the method signature and thus breaking backward compatibility.
    We'll revisit this issue on the next major version release.

  2. tocker
    added
    enhancement
    on May 18, 2016
  3. tocker
    self-assigned this
    on May 18, 2016
  4. rocketraman commented on Jun 2, 2016

    @rocketraman
    rocketraman
    on Jun 2, 2016
    More actions

    +1

    You may have a point here however we cannot change the exception to IOException without changing the method signature and thus breaking backward compatibility.

    Actually you can change it without changing the signature -- the method already declares throws IOException. It just doesn't.

    However, I'd note @JulienArzul's other comment: better to use a custom exception type that allows extracting the status code and a Map that contains the body of the response, or some structured type with the same values.

  5. tocker
    removed their assignment
    on Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.