Skip to content

Commit

Permalink
fix(DBCluster): Throw DBClusterNotFoundException when the DBCluster l…
Browse files Browse the repository at this point in the history
…ist is empty in describe
  • Loading branch information
angusy29 authored and zrfr committed Sep 4, 2024
1 parent fadd9df commit a4a70a6
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ protected DBCluster fetchDBCluster(
Translator.describeDbClustersRequest(model),
proxyClient.client()::describeDBClusters
);

if (response.dbClusters().isEmpty()) {
throw DbClusterNotFoundException.builder()
.message(String.format("No clusters of identifier %s returned from describe call", model.getDBClusterIdentifier()))
.build();
}

return response.dbClusters().get(0);
}

Expand Down

0 comments on commit a4a70a6

Please sign in to comment.