@Test(expected = MaxlagErrorException.class) public void testMaxlagError() throws MediaWikiApiErrorException { MediaWikiApiErrorHandler.throwMediaWikiApiErrorException( MediaWikiApiErrorHandler.ERROR_MAXLAG, "Waiting for 10.64.16.27: 2 seconds lagged"); }
public static void throwMediaWikiApiErrorException(String errorCode, String errorMessage) throws MediaWikiApiErrorException { switch (errorCode) { case ERROR_NO_TOKEN: case ERROR_INVALID_TOKEN: throw new TokenErrorException(errorCode, errorMessage); case ERROR_EDIT_CONFLICT: throw new EditConflictErrorException(errorMessage); case ERROR_NO_SUCH_ENTITY: throw new NoSuchEntityErrorException(errorMessage); case ERROR_MAXLAG: throw new MaxlagErrorException(errorMessage); case ERROR_ASSERT_USER_FAILED: throw new AssertUserFailedException(errorMessage); case ERROR_TAGS_APPLY_NOT_ALLOWED: throw new TagsApplyNotAllowedException(errorMessage); default: throw new MediaWikiApiErrorException(errorCode, errorMessage); } }
MediaWikiApiErrorHandler { public static void throwMediaWikiApiErrorException(String errorCode, String errorMessage) throws MediaWikiApiErrorException { switch (errorCode) { case ERROR_NO_TOKEN: case ERROR_INVALID_TOKEN: throw new TokenErrorException(errorCode, errorMessage); case ERROR_EDIT_CONFLICT: throw new EditConflictErrorException(errorMessage); case ERROR_NO_SUCH_ENTITY: throw new NoSuchEntityErrorException(errorMessage); case ERROR_MAXLAG: throw new MaxlagErrorException(errorMessage); case ERROR_ASSERT_USER_FAILED: throw new AssertUserFailedException(errorMessage); case ERROR_TAGS_APPLY_NOT_ALLOWED: throw new TagsApplyNotAllowedException(errorMessage); default: throw new MediaWikiApiErrorException(errorCode, errorMessage); } } }
MediaWikiApiErrorHandler { public static void throwMediaWikiApiErrorException(String errorCode, String errorMessage) throws MediaWikiApiErrorException { switch (errorCode) { case ERROR_NO_TOKEN: case ERROR_INVALID_TOKEN: throw new TokenErrorException(errorCode, errorMessage); case ERROR_EDIT_CONFLICT: throw new EditConflictErrorException(errorMessage); case ERROR_NO_SUCH_ENTITY: throw new NoSuchEntityErrorException(errorMessage); case ERROR_MAXLAG: throw new MaxlagErrorException(errorMessage); case ERROR_ASSERT_USER_FAILED: throw new AssertUserFailedException(errorMessage); case ERROR_TAGS_APPLY_NOT_ALLOWED: throw new TagsApplyNotAllowedException(errorMessage); default: throw new MediaWikiApiErrorException(errorCode, errorMessage); } }  }
MediaWikiApiErrorHandler { public static void throwMediaWikiApiErrorException(String errorCode, String errorMessage) throws MediaWikiApiErrorException { switch (errorCode) { case ERROR_NO_TOKEN: case ERROR_INVALID_TOKEN: throw new TokenErrorException(errorCode, errorMessage); case ERROR_EDIT_CONFLICT: throw new EditConflictErrorException(errorMessage); case ERROR_NO_SUCH_ENTITY: throw new NoSuchEntityErrorException(errorMessage); case ERROR_MAXLAG: throw new MaxlagErrorException(errorMessage); case ERROR_ASSERT_USER_FAILED: throw new AssertUserFailedException(errorMessage); case ERROR_TAGS_APPLY_NOT_ALLOWED: throw new TagsApplyNotAllowedException(errorMessage); default: throw new MediaWikiApiErrorException(errorCode, errorMessage); } }  static void throwMediaWikiApiErrorException(String errorCode,
			String errorMessage); }
MediaWikiApiErrorHandler { public static void throwMediaWikiApiErrorException(String errorCode, String errorMessage) throws MediaWikiApiErrorException { switch (errorCode) { case ERROR_NO_TOKEN: case ERROR_INVALID_TOKEN: throw new TokenErrorException(errorCode, errorMessage); case ERROR_EDIT_CONFLICT: throw new EditConflictErrorException(errorMessage); case ERROR_NO_SUCH_ENTITY: throw new NoSuchEntityErrorException(errorMessage); case ERROR_MAXLAG: throw new MaxlagErrorException(errorMessage); case ERROR_ASSERT_USER_FAILED: throw new AssertUserFailedException(errorMessage); case ERROR_TAGS_APPLY_NOT_ALLOWED: throw new TagsApplyNotAllowedException(errorMessage); default: throw new MediaWikiApiErrorException(errorCode, errorMessage); } }  static void throwMediaWikiApiErrorException(String errorCode,
			String errorMessage); final static String ERROR_EDIT_CONFLICT; final static String ERROR_NO_TOKEN; final static String ERROR_INVALID_TOKEN; final static String ERROR_NO_SUCH_ENTITY; final static String ERROR_MAXLAG; final static String ERROR_ASSERT_USER_FAILED; final static String ERROR_TAGS_APPLY_NOT_ALLOWED; }