yield result code from http error handler

This commit is contained in:
Jonathan Shook 2021-05-13 12:58:27 -05:00
parent 9a7a897018
commit 3809db4b47

View File

@ -77,6 +77,8 @@ public class HttpAction implements SyncAction {
} finally { } finally {
} }
int resultCode=0;
while (tries < maxTries) { while (tries < maxTries) {
tries++; tries++;
@ -128,6 +130,7 @@ public class HttpAction implements SyncAction {
} else { } else {
// count and log exception types // count and log exception types
ErrorDetail detail = httpActivity.getErrorHandler().handleError(error, cycle, nanos); ErrorDetail detail = httpActivity.getErrorHandler().handleError(error, cycle, nanos);
resultCode=detail.resultCode;
if (!detail.isRetryable()) { if (!detail.isRetryable()) {
break; // break out of the tries loop without retrying, because the error handler said so break; // break out of the tries loop without retrying, because the error handler said so
} }
@ -139,7 +142,7 @@ public class HttpAction implements SyncAction {
httpActivity.triesHisto.update(tries); httpActivity.triesHisto.update(tries);
return 0; return resultCode;
} }
private HttpRequest.BodyPublisher bodySourceFrom(Map<String, String> cmdMap) { private HttpRequest.BodyPublisher bodySourceFrom(Map<String, String> cmdMap) {