You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 !).
The text was updated successfully, but these errors were encountered:
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.
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.
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 !).
The text was updated successfully, but these errors were encountered: