comparison src/org/tmatesoft/hg/core/HgCallbackTargetException.java @ 370:a2341e761609

Let callback implementations deliver errors (e,g. own exceptions) to client code
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 22 Dec 2011 02:37:10 +0300
parents 2fadf8695f8a
children f52ca9530774
comparison
equal deleted inserted replaced
369:091666b87f62 370:a2341e761609
19 import org.tmatesoft.hg.util.Path; 19 import org.tmatesoft.hg.util.Path;
20 20
21 21
22 22
23 /** 23 /**
24 * Checked exception that indicates errors in client code and tries to supply extra information about the context it occured in. 24 * Checked exception that indicates errors in client code and tries to supply extra information about the context it occurred in.
25 *
26 * Generally, client need to pass own error information/exceptions from within implementations of the callback methods they supply.
27 * However, there's no straightforward way to alter throws clause for these methods, and alternatives like generic {@link Exception} or
28 * library's own {@link HgException} are rather obscure. Suggested approach is to wrap whatever exception user code produces with
29 * {@link RuntimeException} subclass, {@link Wrap}. Then, unwrap and re-throw with checked {@link HgCallbackTargetException}.
30 *
31 * FIXME REVISIT perhaps, shall just throw HgCallbackTargetException from any handler, and do not catch anything in commands at all?
25 * 32 *
26 * @author Artem Tikhomirov 33 * @author Artem Tikhomirov
27 * @author TMate Software Ltd. 34 * @author TMate Software Ltd.
28 */ 35 */
29 @SuppressWarnings("serial") 36 @SuppressWarnings("serial")