Skip to content

Commit

Permalink
add validation
Browse files Browse the repository at this point in the history
  • Loading branch information
badmintoncryer committed Mar 1, 2025
1 parent b70e38d commit bcec1bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/aws-cdk-lib/aws-ecr/lib/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,10 @@ export class Repository extends RepositoryBase {
throw new Error('Cannot look up a repository with a tokenized name or ARN.');
}

if (!options.repositoryArn && !options.repositoryName) {
throw new Error('At least one of `repositoryName` or `repositoryArn` must be provided.');
}

const response: {[key: string]: any}[] = ContextProvider.getValue(scope, {
provider: cxschema.ContextProvider.CC_API_PROVIDER,
props: {
Expand Down

0 comments on commit bcec1bd

Please sign in to comment.