Bug 740731 - Catch unchecked exceptions in two places in BaseResource. r=rnewman
This commit is contained in:
@@ -9,6 +9,7 @@ import java.io.IOException;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
@@ -249,6 +250,10 @@ public class BaseResource implements Resource {
|
||||
delegate.handleHttpProtocolException(e);
|
||||
} catch (IOException e) {
|
||||
delegate.handleHttpIOException(e);
|
||||
} catch (Exception e) {
|
||||
// Bug 740731: Don't let an exception fall through. Wrapping isn't
|
||||
// optimal, but often the exception is treated as an Exception anyway.
|
||||
delegate.handleHttpIOException(new IOException(e));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,9 +267,16 @@ public class BaseResource implements Resource {
|
||||
} catch (KeyManagementException e) {
|
||||
Logger.error(LOG_TAG, "Couldn't prepare client.", e);
|
||||
delegate.handleTransportException(e);
|
||||
return;
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
Logger.error(LOG_TAG, "Couldn't prepare client.", e);
|
||||
delegate.handleTransportException(e);
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
// Bug 740731: Don't let an exception fall through. Wrapping isn't
|
||||
// optimal, but often the exception is treated as an Exception anyway.
|
||||
delegate.handleTransportException(new GeneralSecurityException(e));
|
||||
return;
|
||||
}
|
||||
this.execute();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user