Skip to content

Commit

Permalink
Polishing #620
Browse files Browse the repository at this point in the history
Add Javadoc to exceptions.
  • Loading branch information
mp911de committed Oct 11, 2017
1 parent 1ea8907 commit 6735981
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,33 @@
@SuppressWarnings("serial")
public class RedisCommandExecutionException extends RedisException {

public RedisCommandExecutionException(Throwable cause) {
super(cause);
}

/**
* Create a {@code RedisCommandExecutionException} with the specified detail message.
*
* @param msg the detail message.
*/
public RedisCommandExecutionException(String msg) {
super(msg);
}

public RedisCommandExecutionException(String msg, Throwable e) {
super(msg, e);
/**
* Create a {@code RedisCommandExecutionException} with the specified detail message and nested exception.
*
* @param msg the detail message.
* @param cause the nested exception.
*/
public RedisCommandExecutionException(String msg, Throwable cause) {
super(msg, cause);
}

/**
* Create a {@code RedisCommandExecutionException} with the specified nested exception.
*
* @param msg the detail message.
* @param cause the nested exception.
*/
public RedisCommandExecutionException(Throwable cause) {
super(cause);
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2016 the original author or authors.
* Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,11 +19,17 @@
* Exception thrown when the thread executing a redis command is interrupted.
*
* @author Will Glozer
* @author Mark Paluch
*/
@SuppressWarnings("serial")
public class RedisCommandInterruptedException extends RedisException {

public RedisCommandInterruptedException(Throwable e) {
super("Command interrupted", e);
/**
* Create a {@code RedisCommandInterruptedException} with the specified nested exception.
*
* @param cause the nested exception.
*/
public RedisCommandInterruptedException(Throwable cause) {
super("Command interrupted", cause);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2016 the original author or authors.
* Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,10 +23,18 @@
@SuppressWarnings("serial")
public class RedisCommandTimeoutException extends RedisException {

/**
* Create a {@code RedisCommandTimeoutException} with a default message.
*/
public RedisCommandTimeoutException() {
super("Command timed out");
}

/**
* Create a {@code RedisCommandTimeoutException} with the specified detail message.
*
* @param msg the detail message.
*/
public RedisCommandTimeoutException(String msg) {
super(msg);
}
Expand Down
21 changes: 16 additions & 5 deletions src/main/java/com/lambdaworks/redis/RedisConnectionException.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,31 @@
@SuppressWarnings("serial")
public class RedisConnectionException extends RedisException {

/**
* Create a {@code RedisConnectionException} with the specified detail message.
*
* @param msg the detail message.
*/
public RedisConnectionException(String msg) {
super(msg);
}

public RedisConnectionException(String msg, Throwable e) {
super(msg, e);
/**
* Create a {@code RedisConnectionException} with the specified detail message and nested exception.
*
* @param msg the detail message.
* @param cause the nested exception.
*/
public RedisConnectionException(String msg, Throwable cause) {
super(msg, cause);
}

/**
* Create a new {@link RedisConnectionException} given {@link SocketAddress} and the {@link Throwable cause}.
*
* @param remoteAddress
* @param cause
* @return
* @param remoteAddress remote socket address.
* @param cause the nested exception.
* @return the {@link RedisConnectionException}.
* @since 4.4
*/
public static RedisConnectionException create(SocketAddress remoteAddress, Throwable cause) {
Expand Down
20 changes: 19 additions & 1 deletion src/main/java/com/lambdaworks/redis/RedisException.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2016 the original author or authors.
* Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,18 +19,36 @@
* Exception thrown when Redis returns an error message, or when the client fails for any reason.
*
* @author Will Glozer
* @author Mark Paluch
*/
@SuppressWarnings("serial")
public class RedisException extends RuntimeException {

/**
* Create a {@code RedisException} with the specified detail message.
*
* @param msg the detail message.
*/
public RedisException(String msg) {
super(msg);
}

/**
* Create a {@code RedisException} with the specified detail message and nested exception.
*
* @param msg the detail message.
* @param cause the nested exception.
*/
public RedisException(String msg, Throwable e) {
super(msg, e);
}

/**
* Create a {@code RedisException} with the specified nested exception.
*
* @param msg the detail message.
* @param cause the nested exception.
*/
public RedisException(Throwable cause) {
super(cause);
}
Expand Down

0 comments on commit 6735981

Please sign in to comment.