code: public void onError(Exception parentException, Context context) throws AdvancedActionException
     {
        int eventId = (Integer)context.get(InvocationContext.EVENT);
        if (eventId != ExtendedEvent.READ)
        {
           Item item = (Item)context.get(InvocationContext.CURRENT_ITEM);
           try
           {
              item.getSession().refresh(false);
           }
           catch (RepositoryException e)
           {
              e.initCause(parentException);
              throw new AdvancedActionException(this.getClass().getName() + " changes rollback failed:", e);
           }
        }
        if (parentException instanceof AdvancedActionException)
        {
           throw (AdvancedActionException)parentException;
        }
        else
        {
           LOG.error(this.getClass().getName() + " throwed an exception:", parentException);
        }
     }
docs: Simple implementation of onError() method. It reverts all pending changes of the current JCR session for any kind of event corresponding to a write operation.
  Then in case the provided parentException is an instance of type AdvancedActionException, it will throw it otherwise it will log simply it.
  An AdvancedActionException will be thrown in case the changes could not be reverted.
  @see org.exoplatform.services.jcr.impl.ext.action.AdvancedAction#onError(java.lang.Exception, org.apache.commons.chain.Context)