diff --git a/src/main/java/com/basho/riak/pbc/KeySource.java b/src/main/java/com/basho/riak/pbc/KeySource.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/basho/riak/pbc/KeySource.java
+++ b/src/main/java/com/basho/riak/pbc/KeySource.java
@@ -85,7 +85,7 @@ public class KeySource extends RiakStreamClient<ByteString> {
 
                 r = RPB.RpbListKeysResp.parseFrom(data);
                 i = 0;
-            } catch (RiakError e) {
+            } catch (IOException e) {
                 close();
                 throw e;
             }
diff --git a/src/main/java/com/basho/riak/pbc/MapReduceResponseSource.java b/src/main/java/com/basho/riak/pbc/MapReduceResponseSource.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/basho/riak/pbc/MapReduceResponseSource.java
+++ b/src/main/java/com/basho/riak/pbc/MapReduceResponseSource.java
@@ -91,7 +91,7 @@ public class MapReduceResponseSource extends
             }
             r = RPB.RpbMapRedResp.parseFrom(data);
             is_given = false;
-        } catch (RiakError e) {
+        } catch (IOException e) {
             close();
             throw e;
         }
Catch more general IOException and close RiakConnection