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; }
TargettedMessage general = messages.findGeneralError(); if (general != null) { general.args[0] = errortoken;