provide better diagnostics for interrupted annotation post

This commit is contained in:
Jonathan Shook 2023-12-15 23:10:48 -06:00
parent b63fcf2625
commit 1bda5446d5

View File

@ -203,6 +203,8 @@ public class GrafanaClient {
try {
HttpRequest request = rqb.build();
response = client.send(request, HttpResponse.BodyHandlers.ofString());
} catch (InterruptedException ie) {
logger.warn("The annotation client was interrupted while submitting a request.");
} catch (Exception e) {
if (e.getMessage()!=null && e.getMessage().contains("WWW-Authenticate header missing")) {
throw new RuntimeException("Java HttpClient was not authorized, and it saw no WWW-Authenticate header" +