use of com.adobe.acs.commons.fam.Failure in project acs-aem-commons by Adobe-Consulting-Services.
the class ActionManagerImpl method logError.
private void logError(Exception ex) {
LOG.error("Caught exception in task: " + ex.getMessage(), ex);
Failure fail = new Failure();
fail.setNodePath(currentPath.get());
fail.setException(ex);
failures.add(fail);
tasksCompleted.incrementAndGet();
tasksError.incrementAndGet();
if (isComplete()) {
finished = System.currentTimeMillis();
performAutomaticCleanup();
}
}
use of com.adobe.acs.commons.fam.Failure in project acs-aem-commons by Adobe-Consulting-Services.
the class ActionManagerImpl method getFailures.
@Override
public List<CompositeData> getFailures() throws OpenDataException {
ArrayList<CompositeData> failureData = new ArrayList<>();
int count = 0;
for (Failure fail : failures) {
if (count > 5000) {
break;
}
failureData.add(new CompositeDataSupport(failureCompositeType, failureItemNames, new Object[] { name, ++count, fail.getNodePath(), fail.getException() == null ? "Unknown" : fail.getException().getMessage() }));
}
return failureData;
}
use of com.adobe.acs.commons.fam.Failure in project acs-aem-commons by Adobe-Consulting-Services.
the class ActionManagerImpl method logPersistenceException.
private void logPersistenceException(List<String> items, PersistenceException ex) {
StringBuilder itemList = new StringBuilder();
for (String item : items) {
itemList.append(item).append("; ");
Failure fail = new Failure();
fail.setNodePath(item);
fail.setException(ex);
failures.add(fail);
tasksError.incrementAndGet();
tasksSuccessful.decrementAndGet();
}
LOG.error("Persistence error prevented saving changes for: " + itemList, ex);
}
use of com.adobe.acs.commons.fam.Failure in project acs-aem-commons by Adobe-Consulting-Services.
the class ProcessInstanceImpl method run.
@Override
public final void run(ResourceResolver rr) {
try {
infoBean.setRequester(rr.getUserID());
infoBean.setStartTime(System.currentTimeMillis());
definition.buildProcess(this, rr);
infoBean.setIsRunning(true);
runStep(0);
} catch (LoginException | RepositoryException ex) {
Failure f = new Failure();
f.setException(ex);
f.setNodePath(getPath());
recordErrors(-1, Arrays.asList(f), rr);
LOG.error("Error starting managed process " + getName(), ex);
halt();
}
}
Aggregations