Skip to content

Commit

Permalink
Merge pull request #47 from companieshouse/feature/DSND-1196_remove_l…
Browse files Browse the repository at this point in the history
…ogger

Reduce 404 error logging for a delete
  • Loading branch information
osamo-oas authored Jul 27, 2022
2 parents e01c6b9 + 17aa7c7 commit dc2ed07
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.util.HashMap;
import java.util.Map;
import org.springframework.http.HttpStatus;
import org.springframework.web.server.ResponseStatusException;
import uk.gov.companieshouse.api.error.ApiErrorResponseException;
import uk.gov.companieshouse.api.handler.Executor;
import uk.gov.companieshouse.api.handler.exception.URIValidationException;
Expand Down Expand Up @@ -56,6 +55,11 @@ public <T> ApiResponse<T> executeOp(final String logContext,
"400 BAD_REQUEST response received from disqualified-officers-data-api";
logger.errorContext(logContext, msg, ex, logMap);
throw new NonRetryableErrorException(msg, ex);
} else if (ex.getStatusCode() == HttpStatus.NOT_FOUND.value()
&& operationName.equals("deleteDisqualification")) {
String msg =
"404 NOT_FOUND response received from disqualified-officers-data-api";
throw new RetryableErrorException(msg);
}

// any other client or server status is retryable
Expand Down

0 comments on commit dc2ed07

Please sign in to comment.