Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/edu/ksu/canvas/net/SimpleRestClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@ private void checkHeaders(ClassicHttpResponse httpResponse, HttpUriRequestBase r
LOG.error("Object not found in Canvas. Requested URL: " + uri);
throw new ObjectNotFoundException(extractErrorMessageFromResponse(httpResponse), String.valueOf(uri));
}
if(statusCode == 504) {
LOG.error("504 Gateway Time-out while requesting: " + uri);
throw new RetriableException("status code: 504, reason phrase: Gateway Time-out", String.valueOf(uri));
if(statusCode >= 500 && statusCode < 600) {
LOG.error("Error " + statusCode + " while requesting: " + uri);
throw new RetriableException("500 class error with status code: " + statusCode, String.valueOf(uri));
}
// If we receive a 5xx exception, we should not wrap it in an unchecked exception for upstream clients to deal with.
if(statusCode < 200 || (statusCode > (allowRedirect?399:299) && statusCode <= 499)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void http503ServiceTemporarilyUnavailableException() throws Exception {
String url = "/unavailableServiceUrl";
registerUrlResponse(url, "", 503, Collections.emptyMap());

assertThrows(IOException.class, () -> {
assertThrows(RetriableException.class, () -> {
final Response response = restClient.sendApiGet(emptyAdminToken, baseUrl + url, 100, 100);
});
}
Expand Down