add JedisDataException and JedisConnectionException
This commit is contained in:
@@ -3,7 +3,8 @@ package redis.clients.util;
|
||||
import org.apache.commons.pool.PoolableObjectFactory;
|
||||
import org.apache.commons.pool.impl.GenericObjectPool;
|
||||
|
||||
import redis.clients.jedis.JedisException;
|
||||
import redis.clients.jedis.exceptions.JedisConnectionException;
|
||||
import redis.clients.jedis.exceptions.JedisException;
|
||||
|
||||
public abstract class Pool<T> {
|
||||
private final GenericObjectPool internalPool;
|
||||
@@ -18,8 +19,8 @@ public abstract class Pool<T> {
|
||||
try {
|
||||
return (T) internalPool.borrowObject();
|
||||
} catch (Exception e) {
|
||||
throw new JedisException("Could not get a resource from the pool",
|
||||
e);
|
||||
throw new JedisConnectionException(
|
||||
"Could not get a resource from the pool", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ import java.io.FilterInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import redis.clients.jedis.JedisException;
|
||||
import redis.clients.jedis.exceptions.JedisConnectionException;
|
||||
import redis.clients.jedis.exceptions.JedisException;
|
||||
|
||||
public class RedisInputStream extends FilterInputStream {
|
||||
|
||||
@@ -87,13 +88,12 @@ public class RedisInputStream extends FilterInputStream {
|
||||
}
|
||||
String reply = sb.toString();
|
||||
if (reply.length() == 0) {
|
||||
throw new JedisException(
|
||||
throw new JedisConnectionException(
|
||||
"It seems like server has closed the connection.");
|
||||
}
|
||||
return reply;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] b, int off, int len) throws IOException {
|
||||
if (count == limit) {
|
||||
fill();
|
||||
|
||||
@@ -2,8 +2,8 @@ package redis.clients.util;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import redis.clients.jedis.JedisException;
|
||||
import redis.clients.jedis.Protocol;
|
||||
import redis.clients.jedis.exceptions.JedisException;
|
||||
|
||||
/**
|
||||
* The only reason to have this is to be able to compatible with java 1.5 :(
|
||||
|
||||
Reference in New Issue
Block a user