diff --git a/lib/src/rate_limiter.dart b/lib/src/rate_limiter.dart index 36477ebf..dbe5a287 100644 --- a/lib/src/rate_limiter.dart +++ b/lib/src/rate_limiter.dart @@ -26,7 +26,8 @@ abstract class RateLimiter { final String errorMessage; RateLimiter(this.maxPointsPerWindow, this.windowDuration, - {this.errorMessage = 'Rate limit exceeded.'}); + {String errorMessage}) + : this.errorMessage = errorMessage ?? 'Rate limit exceeded.'; /// Computes the current window in which the user is acting. ///