diff --git a/src/main/java/com/threerings/presents/server/InvocationException.java b/src/main/java/com/threerings/presents/server/InvocationException.java index 400086afb..bd6e0fcf7 100644 --- a/src/main/java/com/threerings/presents/server/InvocationException.java +++ b/src/main/java/com/threerings/presents/server/InvocationException.java @@ -54,6 +54,18 @@ public class InvocationException extends Exception requireAccess(clobj, perm, null); } + /** + * Requires that the supplied condition be true, otherwise an invocation exception with the + * supplied error message is thrown. + */ + public static void require (boolean condition, String errmsg) + throws InvocationException + { + if (!condition) { + throw new InvocationException(errmsg); + } + } + /** * Constructs an invocation exception with the supplied cause code string. */