diff --git a/src/throttler.guard.ts b/src/throttler.guard.ts index 429fa6d6..886b3d13 100644 --- a/src/throttler.guard.ts +++ b/src/throttler.guard.ts @@ -171,12 +171,18 @@ export class ThrottlerGuard implements CanActivate { * the method. * @throws {ThrottlerException} */ - // eslint-disable-next-line @typescript-eslint/no-unused-vars - protected throwThrottlingException( + protected async throwThrottlingException( context: ExecutionContext, throttlerLimitDetail: ThrottlerLimitDetail, - ): void { - throw new ThrottlerException(this.errorMessage); + ): Promise { + throw new ThrottlerException(await this.getErrorMessage(context, throttlerLimitDetail)); + } + + protected async getErrorMessage( + _context: ExecutionContext, + _throttlerLimitDetail: ThrottlerLimitDetail, + ): Promise { + return this.errorMessage; } private async resolveValue(