Skip to content

Commit

Permalink
more specific exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe-lyons committed Jun 29, 2022
1 parent c805b45 commit 18aca66
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ private void setSiblingsAndSoftDeleteSibling(Urn dbtUrn, Urn sourceUrn) {
newSiblingsUrnArray.stream().filter(urn -> {
try {
return _entityClient.exists(urn, _systemAuthentication);
} catch (Exception e) {
} catch (RemoteInvocationException e) {
log.error("Error while checking existence of {}: {}", urn.toString(), e.toString());
throw new RuntimeException("Error checking existence. Skipping processing.", e);
}
Expand Down Expand Up @@ -392,7 +392,7 @@ private SubTypes getSubtypesFromEntityClient(
} else {
return null;
}
} catch (Exception e) {
} catch (RemoteInvocationException | URISyntaxException e) {
throw new RuntimeException("Failed to retrieve Subtypes", e);
}
}
Expand All @@ -413,7 +413,7 @@ private UpstreamLineage getUpstreamLineageFromEntityClient(
} else {
return null;
}
} catch (Exception e) {
} catch (RemoteInvocationException | URISyntaxException e) {
throw new RuntimeException("Failed to retrieve UpstreamLineage", e);
}
}
Expand All @@ -434,7 +434,7 @@ private Siblings getSiblingsFromEntityClient(
} else {
return null;
}
} catch (Exception e) {
} catch (RemoteInvocationException | URISyntaxException e) {
throw new RuntimeException("Failed to retrieve UpstreamLineage", e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,5 +297,5 @@ public DataMap getRawAspect(@Nonnull String urn, @Nonnull String aspect, @Nonnul
public void producePlatformEvent(@Nonnull String name, @Nullable String key, @Nonnull PlatformEvent event,
@Nonnull Authentication authentication) throws Exception;

Boolean exists(Urn urn, @Nonnull Authentication authentication) throws Exception;
Boolean exists(Urn urn, @Nonnull Authentication authentication) throws RemoteInvocationException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ public void producePlatformEvent(
}

@Override
public Boolean exists(Urn urn, @Nonnull Authentication authentication) throws Exception {
public Boolean exists(Urn urn, @Nonnull Authentication authentication) throws RemoteInvocationException {
return _entityService.exists(urn);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ public void producePlatformEvent(@Nonnull String name, @Nullable String key, @No
}

@Override
public Boolean exists(Urn urn, @Nonnull Authentication authentication) throws Exception {
public Boolean exists(Urn urn, @Nonnull Authentication authentication) throws RemoteInvocationException {
final EntitiesDoExistsRequestBuilder requestBuilder =
ENTITIES_REQUEST_BUILDERS.actionExists().urnParam(urn.toString());
return sendClientRequest(requestBuilder, authentication).getEntity();
Expand Down

0 comments on commit 18aca66

Please sign in to comment.