{"record":{"id":"8b9cdddb0fb56357","repo":"ytti/oxidized","slug":"cannot-find-hook-hook-type-inspect","errorCode":null,"errorMessage":"cannot find hook #{hook_type.inspect}","messagePattern":"cannot find hook #(.+?)","errorType":"validation","errorClass":"KeyError","httpStatus":null,"severity":"error","filePath":"lib/oxidized/hook.rb","lineNumber":54,"sourceCode":"      source_node_transform\n    ].freeze\n    attr_reader :registered_hooks\n\n    def initialize\n      @registered_hooks = Hash.new { |h, k| h[k] = [] }\n    end\n\n    def register(event, name, hook_type, cfg)\n      unless EVENTS.include? event\n        raise ArgumentError,\n              \"unknown event #{event}, available: #{EVENTS.join ','}\"\n      end\n\n      Oxidized.mgr.add_hook(hook_type) || raise(\"cannot load hook '#{hook_type}', not found\")\n      begin\n        hook = Oxidized.mgr.hook.fetch(hook_type).new\n      rescue KeyError\n        raise KeyError, \"cannot find hook #{hook_type.inspect}\"\n      end\n\n      hook.cfg = cfg\n\n      @registered_hooks[event] << RegisteredHook.new(name, hook)\n      logger.debug \"Hook #{name.inspect} registered #{hook.class} for event #{event.inspect}\"\n    end\n\n    # --- Transform events ---\n\n    # Runs source_node_transform hooks in sequence, passing the return value of\n    # each hook as node to the next. Returns the final node, or nil\n    # to signal that the node should be excluded.\n    def source_node_transform(node:, node_raw:, context:)\n      ctx = HookContext.new(\n        event:    :source_node_transform,\n        node:     node,\n        node_raw: node_raw,","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/ytti/oxidized/blob/687ed4262d9d21e54662e872e2383386d8498f7b/lib/oxidized/hook.rb#L36-L72","documentation":"Error \"cannot find hook #{hook_type.inspect}\" thrown in ytti/oxidized.","triggerScenarios":"Thrown at lib/oxidized/hook.rb:54 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"687ed4262d9d21e54662e872e2383386d8498f7b","analyzedAt":"2026-08-23T11:19:42.084Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}