opensearch-project / opensearch-spark

Spark Accelerator framework ; It enables secondary indices to remote data stores.
Apache License 2.0
22 stars 33 forks source link

Rethrow exception in writeData() #943

Closed noCharger closed 8 hours ago

noCharger commented 10 hours ago

Description

Rethrow exception in writeData() so that this can be recorded at top level

      try {
        dataToWrite.foreach(df => writeDataFrameToOpensearch(df, resultIndex, osClient))
      } catch {
        case t: Throwable =>
          throwableHandler.recordThrowable(
            s"Failed to write to result index. originalError='${throwableHandler.error}'",
            t)
      }

Check List

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.