Mercurial > hg4j
comparison src/org/tmatesoft/hg/repo/HgInvalidControlFileException.java @ 628:6526d8adbc0f
Explicit HgRuntimeException to facilitate easy switch from runtime to checked exceptions
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 22 May 2013 15:52:31 +0200 |
parents | 51d682cf9cdc |
children |
comparison
equal
deleted
inserted
replaced
627:5153eb73b18d | 628:6526d8adbc0f |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2011-2012 TMate Software Ltd | 2 * Copyright (c) 2011-2013 TMate Software Ltd |
3 * | 3 * |
4 * This program is free software; you can redistribute it and/or modify | 4 * This program is free software; you can redistribute it and/or modify |
5 * it under the terms of the GNU General Public License as published by | 5 * it under the terms of the GNU General Public License as published by |
6 * the Free Software Foundation; version 2 of the License. | 6 * the Free Software Foundation; version 2 of the License. |
7 * | 7 * |
16 */ | 16 */ |
17 package org.tmatesoft.hg.repo; | 17 package org.tmatesoft.hg.repo; |
18 | 18 |
19 import java.io.File; | 19 import java.io.File; |
20 | 20 |
21 import org.tmatesoft.hg.core.HgIOException; | |
21 import org.tmatesoft.hg.core.Nodeid; | 22 import org.tmatesoft.hg.core.Nodeid; |
22 import org.tmatesoft.hg.util.Path; | 23 import org.tmatesoft.hg.util.Path; |
23 | 24 |
24 /** | 25 /** |
25 * Subclass of {@link HgInvalidFileException} to indicate failure to deal with one of <b>Mercurial</b> control files | 26 * Subclass of {@link HgInvalidFileException} to indicate failure to deal with one of <b>Mercurial</b> control files |
32 public class HgInvalidControlFileException extends HgInvalidFileException { | 33 public class HgInvalidControlFileException extends HgInvalidFileException { |
33 // XXX Perhaps, child HgInvalidRevlogException and parent HgInvalidRepositoryFileException? | 34 // XXX Perhaps, child HgInvalidRevlogException and parent HgInvalidRepositoryFileException? |
34 | 35 |
35 public HgInvalidControlFileException(String message, Throwable th, File file) { | 36 public HgInvalidControlFileException(String message, Throwable th, File file) { |
36 super(message, th, file); | 37 super(message, th, file); |
38 } | |
39 | |
40 public HgInvalidControlFileException(HgIOException ex, boolean replaceStackTrace) { | |
41 super(ex.getMessage(), ex.getCause(), ex.getFile()); | |
42 if (replaceStackTrace) { | |
43 setStackTrace(ex.getStackTrace()); | |
44 } | |
37 } | 45 } |
38 | 46 |
39 @Override | 47 @Override |
40 public HgInvalidControlFileException setFile(File file) { | 48 public HgInvalidControlFileException setFile(File file) { |
41 super.setFile(file); | 49 super.setFile(file); |