/** Determines whether any errors have occured during the processing of * the current request. * @return true if errors otherwise false */ public static boolean isError() { return getErrorState().messages.isError(); }
public void interceptActionResult(ARIResult result, ViewParameters incoming, Object actionReturn) { if (!targettedMessageList.isError()) { for (int i = 0; i < pent.size(); ++i) { DataAlterationRequest dar = pent.DARAt(i); try { darapplier.applyAlteration(result, dar, null); } catch (Exception e) { Logger.log.info("Error applying binding to outgoing URL state", e); } } } }
public ARIResult interpretActionResult(ViewParameters incoming, Object result) { ARIResult togo = new ARIResult(); togo.resultingView = incoming; togo.propagateBeans = ARIResult.FLOW_END; boolean matchingrule = false; if (map.navigationRules != null) { for (int i = 0; i < map.navigationRules.size(); ++i) { NavigationRule rule = (NavigationRule) map.navigationRules.get(i); if (rule.fromViewId.viewID.equals(incoming.viewID)) { matchingrule = true; processCaseList(rule.navigationCases, togo, result); } } } List rulesfromviews = (List) fromviews.get(incoming.viewID); if (rulesfromviews != null && rulesfromviews.size() > 0) { matchingrule = true; } processCaseList(rulesfromviews, togo, result); if (messages.isError()) { // Apply this default EARLY so that a following ARI2 can see our decision // However, we *do* need to pick up any flow condition from the desired // NavigationCase. In fact we probably need a separate "onError" form of // NavigationCase "fromOutcome". togo.resultingView = incoming.copyBase(); } return matchingrule? togo : null; }
/** Assert whether the action cycle in question has completed without error * @param response The action cycle to be tested * @param error <code>true</code> if it is to be asserted there was an error, * or <code>false</code> if it is to be asserted there was none. */ protected void assertActionError(ActionResponse response, boolean error) { TargettedMessageList tml = (TargettedMessageList) response.requestContext.locateBean("targettedMessageList"); Assert.assertTrue(errorString(error), !tml.isError() ^ error); }
if (messages.isError()) {
public Object handleError(String returncode, Exception exception, String flowstate, String viewID, TargettedMessage message) { Object code = null; Throwable tohandlet = UniversalRuntimeException.unwrapException(exception); if (tohandlet != null && !(tohandlet instanceof Exception)) { // If it is an Error, throw it out immediately throw UniversalRuntimeException.accumulate(tohandlet); } Exception tohandle = (Exception) tohandlet; for (int i = 0; i < strategies.size(); ++i) { code = strategyAt(i).handleError(returncode, tohandle, flowstate, viewID, message); if (code != null) return code; } if (exception != null && code == null) { // Logger.log.warn("Error invoking action", exception); if (!messages.isError()) { if (messages.findGeneralError() == null) { messages.addMessage(new TargettedMessage( CoreMessages.GENERAL_ACTION_ERROR, new Object[] { "token-placeholder" }, exception)); } } throw UniversalRuntimeException.accumulate(exception, "Error invoking action"); } return null; }