package gw.web /** * Class used to set errors in various web scopes and then return them. */ class ErrorConduit { private construct() {} /** * Add a request-scoped error message, if one exists, and then return it. This method is typically used to * initialize a placeholder variable, which allows us to set the error message into the request scope during * page initialization. This is a useful workaround because there are no lifecycle properties on a page that * are early enough ("afterEnter" is too late). */ static function addRequestScopedErrorMessagePassThrough(errorMessage : String) : String { if (errorMessage != null) { gw.api.util.LocationUtil.addRequestScopedErrorMessage(errorMessage) } return errorMessage } }