Skip to content

Commit 4a9cef3

Browse files
authored
Fix error messaging from prometheus. (#1029)
Signed-off-by: vamsi-amazon <reddyvam@amazon.com>
1 parent 3e30379 commit 4a9cef3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

prometheus/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ private JSONObject readResponse(Response response) throws IOException {
106106
}
107107
} else {
108108
throw new RuntimeException(
109-
String.format("Request to Prometheus is Unsuccessful with : %s", response.message()));
109+
String.format("Request to Prometheus is Unsuccessful with : %s", Objects.requireNonNull(
110+
response.body(), "Response body can't be null").string()));
110111
}
111112
}
112113

0 commit comments

Comments
 (0)