Package io.lettuce.core.internal
Class ExceptionFactory
- java.lang.Object
-
- io.lettuce.core.internal.ExceptionFactory
-
public abstract class ExceptionFactory extends Object
Factory for Redis exceptions.- Since:
- 4.5
- Author:
- Mark Paluch, Tobias Nehrlich
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RedisCommandExecutionException
createExecutionException(String message)
Create aRedisCommandExecutionException
with a detail message.static RedisCommandExecutionException
createExecutionException(String message, Throwable cause)
Create aRedisCommandExecutionException
with a detail message and optionally acause
.static RedisCommandTimeoutException
createTimeoutException(String message, Duration timeout)
Create aRedisCommandTimeoutException
with a detail message given the message and timeout.static RedisCommandTimeoutException
createTimeoutException(Duration timeout)
Create aRedisCommandTimeoutException
with a detail message given the timeout.static String
formatTimeout(Duration duration)
-
-
-
Method Detail
-
createTimeoutException
public static RedisCommandTimeoutException createTimeoutException(Duration timeout)
Create aRedisCommandTimeoutException
with a detail message given the timeout.- Parameters:
timeout
- the timeout value.- Returns:
- the
RedisCommandTimeoutException
.
-
createTimeoutException
public static RedisCommandTimeoutException createTimeoutException(String message, Duration timeout)
Create aRedisCommandTimeoutException
with a detail message given the message and timeout.- Parameters:
message
- the detail message.timeout
- the timeout value.- Returns:
- the
RedisCommandTimeoutException
.
-
createExecutionException
public static RedisCommandExecutionException createExecutionException(String message)
Create aRedisCommandExecutionException
with a detail message. Specific Redis error messages may create subtypes ofRedisCommandExecutionException
.- Parameters:
message
- the detail message.- Returns:
- the
RedisCommandExecutionException
.
-
createExecutionException
public static RedisCommandExecutionException createExecutionException(String message, Throwable cause)
Create aRedisCommandExecutionException
with a detail message and optionally acause
. Specific Redis error messages may create subtypes ofRedisCommandExecutionException
.- Parameters:
message
- the detail message.cause
- the nested exception, may benull
.- Returns:
- the
RedisCommandExecutionException
.
-
-