Skip to content

Commit

Permalink
unwrap remote transport exception
Browse files Browse the repository at this point in the history
Signed-off-by: Surya Sashank Nistala <[email protected]>
  • Loading branch information
eirsep committed Feb 24, 2024
1 parent ced398d commit 8de39be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,11 @@ object DocumentLevelMonitorRunner : MonitorRunner() {
}

override fun onFailure(e: Exception) {
logger.info("Fan out failed")
cont.resumeWithException(e)
logger.info("Fan out failed", e)
if (e.cause is Exception) // unwrap remote transport exception
cont.resumeWithException(e.cause as Exception)
else
cont.resumeWithException(e)
}
},
nodeMap.size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ class MonitorDataSourcesIT : AlertingSingleNodeTestCase() {
.get()
Assert.assertTrue(getAlertsResponse != null)
Assert.assertTrue(getAlertsResponse.alerts.size == 1)
Assert.assertTrue(getAlertsResponse.alerts[0].errorMessage == "IndexClosedException[closed]")
Assert.assertTrue(getAlertsResponse.alerts[0].errorMessage!!.contains("IndexClosedException[closed]"))
// Reopen index
client().admin().indices().open(OpenIndexRequest(index)).get()
// Close queryIndex
Expand Down

0 comments on commit 8de39be

Please sign in to comment.