{"record":{"id":"e47045dbcef7a835","repo":"sds/overcommit","slug":"unable-to-load-hook-type-hook-context-e","errorCode":null,"errorMessage":"Unable to load '#{hook_type}' hook context: '#{e}'","messagePattern":"Unable to load '#(.+?)' hook context: '#(.+?)'","errorType":"exception","errorClass":"Overcommit::Exceptions::HookContextLoadError","httpStatus":null,"severity":"error","filePath":"lib/overcommit/hook_context.rb","lineNumber":15,"sourceCode":"# frozen_string_literal: true\n\n# Utility module which manages the creation of {HookContext}s.\nmodule Overcommit::HookContext\n  def self.create(hook_type, config, args, input, **cli_options)\n    hook_type_class = Overcommit::Utils.camel_case(hook_type)\n    underscored_hook_type = Overcommit::Utils.snake_case(hook_type)\n\n    require \"overcommit/hook_context/#{underscored_hook_type}\"\n\n    Overcommit::HookContext.const_get(hook_type_class).new(config, args, input, **cli_options)\n  rescue LoadError, NameError => e\n    # Could happen when a symlink was created for a hook type Overcommit does\n    # not yet support.\n    raise Overcommit::Exceptions::HookContextLoadError,\n          \"Unable to load '#{hook_type}' hook context: '#{e}'\",\n          e.backtrace\n  end\nend\n","sourceCodeStart":1,"sourceCodeEnd":20,"githubUrl":"https://github.com/sds/overcommit/blob/fee0cd74b26eb81f64b43b7fab17bbb541575cc4/lib/overcommit/hook_context.rb#L1-L20","documentation":"Error \"Unable to load '#{hook_type}' hook context: '#{e}'\" thrown in sds/overcommit.","triggerScenarios":"Thrown at lib/overcommit/hook_context.rb:15 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run hooks from the correct git hook stage; a symlink may exist for a hook type Overcommit does not support — remove unsupported hook symlinks from .git/hooks.","Reinstall the hooks with `overcommit --install` if the hook scripts are stale or mismatched.","Read the inner error shown in the message (LoadError or NameError) for the exact load failure."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fee0cd74b26eb81f64b43b7fab17bbb541575cc4","analyzedAt":"2026-08-23T04:07:28.153Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}