Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
HBobertz committed Jan 24, 2025
1 parent 0e88d95 commit e857045
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-apigateway/lib/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CfnDeployment } from './apigateway.generated';
import { Method } from './method';
import { IRestApi, RestApi, SpecRestApi, RestApiBase } from './restapi';
import { Lazy, RemovalPolicy, Resource, CfnResource } from '../../core';
import { UnscopedValidationError } from '../../core/lib/errors';
import { ValidationError } from '../../core/lib/errors';
import { md5hash } from '../../core/lib/helpers-internal';

export interface DeploymentProps {
Expand Down Expand Up @@ -169,7 +169,7 @@ class LatestDeploymentResource extends CfnDeployment {
// if the construct is locked, it means we are already synthesizing and then
// we can't modify the hash because we might have already calculated it.
if (this.node.locked) {
throw new UnscopedValidationError('Cannot modify the logical ID when the construct is locked');
throw new ValidationError('Cannot modify the logical ID when the construct is locked', this);
}

this.hashComponents.push(data);
Expand Down
8 changes: 4 additions & 4 deletions packages/aws-cdk-lib/aws-apigateway/lib/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Method } from './method';
import { IVpcLink, VpcLink } from './vpc-link';
import * as iam from '../../aws-iam';
import { Lazy, Duration } from '../../core';
import { UnscopedValidationError } from '../../core/lib/errors';
import { UnscopedValidationError, ValidationError } from '../../core/lib/errors';

export interface IntegrationOptions {
/**
Expand Down Expand Up @@ -224,7 +224,7 @@ export class Integration {
* Can be overridden by subclasses to allow the integration to interact with the method
* being integrated, access the REST API object, method ARNs, etc.
*/
public bind(_method: Method): IntegrationConfig {
public bind(method: Method): IntegrationConfig {
let uri = this.props.uri;
const options = this.props.options;

Expand All @@ -236,12 +236,12 @@ export class Integration {
if (vpcLink instanceof VpcLink) {
const targets = vpcLink._targetDnsNames;
if (targets.length > 1) {
throw new UnscopedValidationError("'uri' is required when there are more than one NLBs in the VPC Link");
throw new ValidationError("'uri' is required when there are more than one NLBs in the VPC Link", method);
} else {
return `http://${targets[0]}`;
}
} else {
throw new UnscopedValidationError("'uri' is required when the 'connectionType' is VPC_LINK");
throw new ValidationError("'uri' is required when the 'connectionType' is VPC_LINK", method);
}
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AwsIntegration } from './aws';
import * as iam from '../../../aws-iam';
import * as sfn from '../../../aws-stepfunctions';
import { Token } from '../../../core';
import { UnscopedValidationError } from '../../../core/lib/errors';
import { ValidationError } from '../../../core/lib/errors';
import { IntegrationConfig, IntegrationOptions, PassthroughBehavior } from '../integration';
import { Method } from '../method';
import { Model } from '../model';
Expand Down Expand Up @@ -151,7 +151,7 @@ class StepFunctionsExecutionIntegration extends AwsIntegration {
if (this.stateMachine instanceof sfn.StateMachine) {
const stateMachineType = (this.stateMachine as sfn.StateMachine).stateMachineType;
if (stateMachineType !== sfn.StateMachineType.EXPRESS) {
throw new UnscopedValidationError('State Machine must be of type "EXPRESS". Please use StateMachineType.EXPRESS as the stateMachineType');
throw new ValidationError('State Machine must be of type "EXPRESS". Please use StateMachineType.EXPRESS as the stateMachineType', this.stateMachine);
}

//if not imported, extract the name from the CFN layer to reach the
Expand Down

0 comments on commit e857045

Please sign in to comment.