}
private void recordImportFailure(Owner owner, Map data, Throwable error,
String filename) {
ImportRecord record = new ImportRecord(owner);
Meta meta = (Meta) data.get("meta");
log.error("Recording import failure", error);
if (meta != null) {
record.setGeneratedBy(meta.getPrincipalName());
record.setGeneratedDate(meta.getCreated());
}
record.setUpstreamConsumer(createImportUpstreamConsumer(owner, null));
record.setFileName(filename);
record.recordStatus(ImportRecord.Status.FAILURE, error.getMessage());