Skip to content

Commit

Permalink
add self
Browse files Browse the repository at this point in the history
  • Loading branch information
HBobertz committed Jan 24, 2025
1 parent e857045 commit 24120c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-apigateway/lib/stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { IRestApi, RestApiBase } from './restapi';
import { parseMethodOptionsPath } from './util';
import * as cloudwatch from '../../aws-cloudwatch';
import { ArnFormat, Duration, IResource, Resource, Stack, Token } from '../../core';
import { UnscopedValidationError, ValidationError } from '../../core/lib/errors';
import { ValidationError } from '../../core/lib/errors';

/**
* Represents an APIGateway Stage.
Expand Down Expand Up @@ -472,7 +472,7 @@ export class Stage extends StageBase {
if (self.enableCacheCluster === undefined) {
self.enableCacheCluster = true;
} else if (self.enableCacheCluster === false) {
throw new UnscopedValidationError(`Cannot enable caching for method ${path} since cache cluster is disabled on stage`);
throw new ValidationError(`Cannot enable caching for method ${path} since cache cluster is disabled on stage`, self);
}
}

Expand Down

0 comments on commit 24120c9

Please sign in to comment.