Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Bug 1315466 - Agent is throwing Error while JON server executing Oper…
Browse files Browse the repository at this point in the history
…ations on JBoss server.

Detects if error code is 503 and returns a failure operation result with "server not available" message.
  • Loading branch information
josejulio committed Mar 15, 2016
1 parent e07852a commit 63257bf
Showing 1 changed file with 8 additions and 3 deletions.
Expand Up @@ -417,9 +417,14 @@ private JsonNode deserializeResponseBody(Operation operation, StatusLine statusL
try {
operationResult = mapper.readTree(responseBody);
} catch (IOException ioe) {
String failureDescription = "Failed to deserialize response to " + operation
+ " to JsonNode - response status was " + statusAsString(statusLine) + ", and body was ["
+ responseBody + "]: " + ioe;
String failureDescription = "";
if (statusLine.getStatusCode() == 503) {
failureDescription = "Server not available [" + statusAsString(statusLine) + "]";
} else {
failureDescription = "Failed to deserialize response to " + operation
+ " to JsonNode - response status was " + statusAsString(statusLine) + ", and body was ["
+ responseBody + "]: " + ioe;
}
LOG.error(failureDescription);
operationResult = resultAsJsonNode(FAILURE, failureDescription, ioe,
responseBody.contains("rolled-back=true"));
Expand Down

0 comments on commit 63257bf

Please sign in to comment.