public static function check(string $key, int $limit, int $ttl, string $message = 'Too Many Requests'): void { $key = static::$prefix . '-' . $key; if (static::$driver->increase($key, $ttl) > $limit) { throw new RateLimitException($message,429); } }
当自定义异常处理的时候如果这里不给默认的code,异常接收到是0,导致业务错误码不正确