{"record":{"id":"3ed696aa3c17a76c","repo":"fetlife/rollout","slug":"block-is-required","errorCode":null,"errorMessage":"block is required","messagePattern":"block is required","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/rollout/logging.rb","lineNumber":161,"sourceCode":"        end\n\n        expected_arity = method(event).arity\n        unless args.count == expected_arity\n          raise(\n            ArgumentError,\n            \"Invalid number of arguments for event '#{event}': expected #{expected_arity} but got #{args.count}\",\n          )\n        end\n\n        public_send(event, *args)\n      end\n\n      CONTEXT_THREAD_KEY = :rollout_logging_context\n      WITHOUT_THREAD_KEY = :rollout_logging_disabled\n\n      def with_context(context)\n        raise ArgumentError, \"context must be a Hash\" unless context.is_a?(Hash)\n        raise ArgumentError, \"block is required\" unless block_given?\n\n        Thread.current[CONTEXT_THREAD_KEY] = context\n        yield\n      ensure\n        Thread.current[CONTEXT_THREAD_KEY] = nil\n      end\n\n      def current_context\n        Thread.current[CONTEXT_THREAD_KEY] || {}\n      end\n\n      def without\n        Thread.current[WITHOUT_THREAD_KEY] = true\n        yield\n      ensure\n        Thread.current[WITHOUT_THREAD_KEY] = nil\n      end\n","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/fetlife/rollout/blob/bd318a94887aab2bda25f89d44825a42a573ff34/lib/rollout/logging.rb#L143-L179","documentation":"Error \"block is required\" thrown in fetlife/rollout.","triggerScenarios":"Thrown at lib/rollout/logging.rb:161 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call with_context with a block: Rollout::Logging.with_context({}) { ... }.","Move the code that must run under the context into a do...end block passed to with_context."],"exampleFix":"Rollout::Logging.with_context({ request_id: id }) do\n  rollout.activate(:feature)\nend","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bd318a94887aab2bda25f89d44825a42a573ff34","analyzedAt":"2026-08-23T16:22:44.185Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}