Skip to content

Commit

Permalink
More logs on tile download error
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Jan 24, 2023
1 parent f3cd979 commit e2b3861
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpHeaders;
import org.springframework.http.client.ClientHttpRequest;
import org.springframework.http.client.ClientHttpResponse;

Expand Down Expand Up @@ -228,8 +229,12 @@ protected Tile compute() {
return new Tile(null, getTileIndexX(), getTileIndexY());
} else if (statusCode != HttpStatus.OK) {
String errorMessage = String.format(
"Error making tile request: %s\n\tStatus: %s\n\toutMessage: %s",
"Error making tile request: %s\n\tStatus: %s\n\tStatus message: %s",
this.tileRequest.getURI(), statusCode, response.getStatusText());
LOGGER.debug(String.format(
"Error making tile request: %s\nStatus: %s\nStatus message: %s\nServer:%s\nBody:\n%s",
this.tileRequest.getURI(), statusCode, response.getStatusText(),
response.getHeaders().getFirst(HttpHeaders.SERVER), response.getBody()));
this.registry.counter(baseMetricName + ".error").inc();
if (this.failOnError) {
throw new RuntimeException(errorMessage);
Expand Down

0 comments on commit e2b3861

Please sign in to comment.