Skip to content

Commit

Permalink
Changed log level to warning for 404 (#445)
Browse files Browse the repository at this point in the history
* Changed log level to warning for 404

* Addressed comments

---------

Co-authored-by: Rakhi Agrawal <[email protected]>
  • Loading branch information
rakhiagr and Rakhi Agrawal authored Oct 8, 2024
1 parent abfb659 commit 6cd913f
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import static com.linkedin.metadata.dao.BaseReadDAO.*;
import static com.linkedin.metadata.dao.utils.ModelUtils.*;
import static com.linkedin.metadata.restli.RestliConstants.*;
import static com.linkedin.restli.common.HttpStatus.*;


/**
Expand Down Expand Up @@ -668,12 +669,15 @@ private BackfillResult backfillWithDefault(@Nonnull final Set<URN> urns, @Nonnul
private List<? extends RecordTemplate> getValueFromRoutingGms(@Nonnull URN urn,
Collection<Class<? extends RecordTemplate>> routeAspectClasses) {
return routeAspectClasses.stream().map(routeAspectClass -> {

try {
return getAspectRoutingGmsClientManager().getRoutingGmsClient(routeAspectClass).get(urn);
} catch (Exception exception) {
log.error(String.format("Couldn't get routing aspect %s for %s", routeAspectClass.getSimpleName(), urn),
exception);
} catch (Exception e) {
String logMessage = String.format("Couldn't find routing aspect %s for %s", routeAspectClass.getSimpleName(), urn);
if (e instanceof RestLiServiceException && ((RestLiServiceException) e).getStatus() == S_404_NOT_FOUND) {
log.warn(logMessage, e);
} else {
log.error(logMessage, e);
}
return null;
}
}).filter(Objects::nonNull).collect(Collectors.toList());
Expand Down

0 comments on commit 6cd913f

Please sign in to comment.