Skip to content

Commit a20e141

Browse files
committed
Add throwable to a couple of more CacheException subclasses
Exceptions are recommended to have constructors that accept a cause. Note that cause is a Throwable, not an Exception. Target: trunk Require-notes: no Require-book: no Acked-by: Paul Millar <paul.millar@desy.de> Patch: http://rb.dcache.org/r/5433/
1 parent 5cb9897 commit a20e141

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

modules/dcache/src/main/java/diskCacheV111/util/CacheException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public CacheException(String message)
155155
* permitted, and indicates that the cause is nonexistent or
156156
* unknown.)
157157
*/
158-
public CacheException(String message, Exception cause)
158+
public CacheException(String message, Throwable cause)
159159
{
160160
this(DEFAULT_ERROR_CODE, message, cause);
161161
}
@@ -183,7 +183,7 @@ public CacheException(int rc, String message)
183183
* permitted, and indicates that the cause is nonexistent or
184184
* unknown.)
185185
*/
186-
public CacheException(int rc, String message, Exception cause)
186+
public CacheException(int rc, String message, Throwable cause)
187187
{
188188
super(formatMessage(message), cause);
189189
_message = getMessage();

modules/dcache/src/main/java/diskCacheV111/util/FileInCacheException.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ public class FileInCacheException extends CacheException {
55
private static final long serialVersionUID = -2554947305070917562L;
66

77
public FileInCacheException( String msg ){
8-
super( CacheException.FILE_IN_CACHE , msg ) ;
8+
super(FILE_IN_CACHE, msg);
9+
}
10+
11+
public FileInCacheException(String msg, Throwable cause) {
12+
super(FILE_IN_CACHE, msg, cause);
913
}
1014
}

modules/dcache/src/main/java/diskCacheV111/util/FileNotInCacheException.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ public class FileNotInCacheException extends CacheException {
55
private static final long serialVersionUID = 7790043638464132679L;
66

77
public FileNotInCacheException( String msg ){
8-
super( CacheException.FILE_NOT_IN_REPOSITORY , msg ) ;
8+
super(FILE_NOT_IN_REPOSITORY, msg);
99
}
10+
11+
public FileNotInCacheException(String msg, Throwable cause) {
12+
super(FILE_NOT_IN_REPOSITORY, msg, cause);
13+
}
1014
}

0 commit comments

Comments
 (0)