diff src/org/tmatesoft/hg/core/HgRepoFacade.java @ 423:9c9c442b5f2e

Major refactoring of exception handling. Low-level API uses RuntimeExceptions, while checked are left for higher level
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 23 Mar 2012 22:51:18 +0100
parents 981f9f50bb6c
children 12f668401613
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgRepoFacade.java	Fri Mar 23 21:26:01 2012 +0100
+++ b/src/org/tmatesoft/hg/core/HgRepoFacade.java	Fri Mar 23 22:51:18 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 TMate Software Ltd
+ * Copyright (c) 2011-2012 TMate Software Ltd
  *  
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -66,10 +66,11 @@
 
 	/**
 	 * Tries to find repository starting from the current working directory.
+	 * 
 	 * @return <code>true</code> if found valid repository
-	 * @throws HgInvalidFileException in case of errors during repository initialization
+	 * @throws HgRepositoryNotFoundException if no repository found in working directory
 	 */
-	public boolean init() throws HgInvalidFileException {
+	public boolean init() throws HgRepositoryNotFoundException {
 		repo = new HgLookup(context).detectFromWorkingDir();
 		return repo != null && !repo.isInvalid();
 	}
@@ -79,10 +80,10 @@
 	 * 
 	 * @param repoLocation path to any folder within structure of a Mercurial repository.
 	 * @return <code>true</code> if found valid repository 
-	 * @throws HgInvalidFileException if there are errors accessing specified location
+	 * @throws HgRepositoryNotFoundException if there's no repository at specified location
 	 * @throws IllegalArgumentException if argument is <code>null</code>
 	 */
-	public boolean initFrom(File repoLocation) throws HgInvalidFileException {
+	public boolean initFrom(File repoLocation) throws HgRepositoryNotFoundException {
 		if (repoLocation == null) {
 			throw new IllegalArgumentException();
 		}