Throwing RepositoryNotFoundException when not found.

This commit is contained in:
Winston Li 2014-11-20 11:23:31 +00:00
parent 2c64fb0e4f
commit c42db9eb8b

View file

@ -25,6 +25,13 @@ public class SnapshotRepositoryBuilder implements RepositorySource {
@Override @Override
public Repository getRepositoryWithNameAtRootDirectory(String name, File rootDirectory) throws RepositoryNotFoundException, ServiceNotEnabledException { public Repository getRepositoryWithNameAtRootDirectory(String name, File rootDirectory) throws RepositoryNotFoundException, ServiceNotEnabledException {
try {
if (!writeLatexDataSource.repositoryExists(name)) {
throw new RepositoryNotFoundException(name);
}
} catch (FailedConnectionException e) {
throw new ServiceNotEnabledException();
}
File repositoryDirectory = new File(rootDirectory, name); File repositoryDirectory = new File(rootDirectory, name);
Repository repository = null; Repository repository = null;