locationtech / geotrellis

GeoTrellis is a geographic data processing engine for high performance applications.
http://geotrellis.io
Other
1.34k stars 361 forks source link

AccumuloLayerCopier swallows exceptions #2858

Open bossie opened 5 years ago

bossie commented 5 years ago

This code in geotrellis.spark.io.accumulo.AccumuloLayerCopier#copy instantiates but does not throw the wrapped exception, effectively swallowing it. Since copy returns Unit, the compiler does not complain but simply discards the object.

try {
  getLayerWriter(from).write(to, layerReader.read[K, V, M](from), keyIndex)
} catch {
  case e: Exception => new LayerCopyError(from, to).initCause(e)
}

It seems that the throw keyword is simply forgotten. I can make an attempt to fix it and add a test.

Is it possible to then backport this fix to Geotrellis 1.2?

pomadchin commented 5 years ago

Hey @bossie thanks for your report! I think it's possible to release a new 1.x version if you want. Do you prefer to create PR yourself with the fix?

pomadchin commented 5 years ago

It also looks like all our LayerCopy objects (for all backends) have this bug.

pomadchin commented 5 years ago

I want to reopen it in order not to forget to cherry pick it and make a 1.2.1 release