fer626 / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

Don't rethrow IOException as a RuntimeException because this will crash callers when it's thrown because the compiler doesn't require a catch for RuntimeException #467

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-api-java-client (e.g. 1.5.0-beta)?

1.8.0-beta

Java environment (e.g. Java 6, Android 2.3, App Engine)?

All

Describe the problem.

04-23 14:17:39.140   422  1132 E AndroidRuntime: FATAL EXCEPTION: 
SyncAdapterThread-2
04-23 14:17:39.140   422  1132 E AndroidRuntime: java.lang.RuntimeException: 
java.io.IOException
04-23 14:17:39.140   422  1132 E AndroidRuntime:        at 
com.google.api.client.googleapis.MediaExponentialBackOffPolicy.getNextBackOffMil
lis(MediaExponentialBackOffPolicy.java:61)
04-23 14:17:39.140   422  1132 E AndroidRuntime:        at 
com.google.api.client.http.HttpRequest.execute(HttpRequest.java:883)
04-23 14:17:39.140   422  1132 E AndroidRuntime:        at 
com.google.api.client.googleapis.MediaHttpUploader.upload(MediaHttpUploader.java
:212)
04-23 14:17:39.140   422  1132 E AndroidRuntime:        at 
com.google.api.services.plus.Plus$Photos$Insert.executeUnparsed(Plus.java:5582)
04-23 14:17:39.140   422  1132 E AndroidRuntime:        at 
com.google.api.services.plus.Plus$Photos$Insert.execute(Plus.java:5604)
...

How would you expect it to be fixed?

Rethrow IOException without wrapping as a RuntimeException because this will 
crash callers when it's thrown and the compiler doesn't enforce a catch for 
RuntimeException

Original issue reported on code.google.com by yan...@google.com on 25 Apr 2012 at 11:28

GoogleCodeExporter commented 9 years ago
http://codereview.appspot.com/6132050/

Original comment by rmis...@google.com on 30 Apr 2012 at 1:45

GoogleCodeExporter commented 9 years ago

Original comment by rmis...@google.com on 1 May 2012 at 9:27