If an exception occurs while flushing a bulk the cause of the exception can be lost. This commit ensures that cause of the exception is carried forward and gets logged.
This commit is contained in:
parent
133ba2691f
commit
a22690c9ca
|
@ -88,7 +88,7 @@ public abstract class ExportBulk {
|
||||||
bulk.add(docs);
|
bulk.add(docs);
|
||||||
} catch (ExportException e) {
|
} catch (ExportException e) {
|
||||||
if (exception == null) {
|
if (exception == null) {
|
||||||
exception = new ExportException("failed to add documents to export bulks");
|
exception = new ExportException("failed to add documents to export bulks", e);
|
||||||
}
|
}
|
||||||
exception.addExportException(e);
|
exception.addExportException(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,7 +243,12 @@ public class Exporters extends AbstractLifecycleComponent {
|
||||||
} else {
|
} else {
|
||||||
listener.onFailure(exceptionRef.get());
|
listener.onFailure(exceptionRef.get());
|
||||||
}
|
}
|
||||||
}, listener::onFailure));
|
}, (exception) -> {
|
||||||
|
if (exceptionRef.get() != null) {
|
||||||
|
exception.addSuppressed(exceptionRef.get());
|
||||||
|
}
|
||||||
|
listener.onFailure(exception);
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue