Skip to content

Commit

Permalink
Merge pull request #146 from ExclamationLabs/ExclamationLabs/2024/09/…
Browse files Browse the repository at this point in the history
…connection-broken-exception

Throw connection broken exception on server error
  • Loading branch information
jhill0 authored Sep 27, 2024
2 parents cbaf62c + 16e5c93 commit d7fbac7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and minimize the interactions with the ConnId framework and have much of that
taken care of by a common API.

# Change Log
+ **4.2.7** - Throw ConnectionBrokenException upon server error (09/26/2024)
+ **4.2.6** - FIN-12383 - Change return type of quickTest method (09/19/2024)
+ **4.2.5** - FIN-12386 - Update org.apache.commons.lang3 to version 3.13 (09/17/2024)
+ **4.2.4** - FIN-12383 - Add new test method to Base Connector (08/26/2024)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
software_version=4.2.6
software_version=4.2.7
test_connector_version=3.0.2
spring_boot_version=2.7.18

Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ public <T> RestResponseData<T> executeRequest(
}

Logger.info(this, String.format("Response status code is %d", responseStatusCode));
if (responseStatusCode >= HttpStatus.SC_INTERNAL_SERVER_ERROR) {
throw new ConnectionBrokenException(
"Unexpected server error occurred while attempting request, received status code: "
+ responseStatusCode);
}
if (responseStatusCode >= HttpStatus.SC_BAD_REQUEST) {
Logger.info(
this, String.format("request execution failed; status code is %d", responseStatusCode));
Expand Down Expand Up @@ -347,7 +352,7 @@ public <T> RestResponseData<T> executeRequest(
if (retryCount < getIoErrorRetryCount()) {
return executeRequest(request, true, ++retryCount);
} else {
throw new ConnectorException(
throw new ConnectionBrokenException(
"Unexpected IOException occurred while attempting call: "
+ e.getMessage()
+ ". "
Expand All @@ -359,7 +364,7 @@ public <T> RestResponseData<T> executeRequest(
return executeRequest(request, true, 1);
}
} else {
throw new ConnectorException(
throw new ConnectionBrokenException(
"Unexpected IOException occurred while attempting call: " + e.getMessage(), e);
}
}
Expand Down

0 comments on commit d7fbac7

Please sign in to comment.