Added a static method for concise condition requirey in invocation services.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6583 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -54,6 +54,18 @@ public class InvocationException extends Exception
|
|||||||
requireAccess(clobj, perm, null);
|
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.
|
* Constructs an invocation exception with the supplied cause code string.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user