{"record":{"id":"6283085ebbbf456b","repo":"hashie/hashie","slug":"key-not-found-with-value-of-value-inspect","errorCode":null,"errorMessage":"key not found with value of #{value.inspect}","messagePattern":"key not found with value of #(.+?)","errorType":"exception","errorClass":"KeyError","httpStatus":null,"severity":"error","filePath":"lib/hashie/extensions/strict_key_access.rb","lineNumber":71,"sourceCode":"        raise DefaultError\n      end\n\n      def default=(_)\n        raise DefaultError\n      end\n\n      def default_proc\n        raise DefaultError\n      end\n\n      def default_proc=(_)\n        raise DefaultError\n      end\n\n      def key(value)\n        super.tap do |result|\n          if result.nil? && (!key?(result) || self[result] != value)\n            raise KeyError, \"key not found with value of #{value.inspect}\"\n          end\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":53,"sourceCodeEnd":78,"githubUrl":"https://github.com/hashie/hashie/blob/fde8e03a0a19da626576415223e4b002fc373967/lib/hashie/extensions/strict_key_access.rb#L53-L78","documentation":"Error \"key not found with value of #{value.inspect}\" thrown in hashie/hashie.","triggerScenarios":"Calling hash.key(value) on a Hash including Hashie::Extensions::StrictKeyAccess when no key maps to that value.","commonSituations":"Reverse-lookup of a key by value where the value is absent, on a strict hash that converts the nil result into a KeyError.","solutions":["Ensure a key with exactly that value exists before calling hash.key(value); the comparison uses ==, so types must match.","Use hash.rassoc or iterate hash.each to find near-matches if the value may differ slightly.","Rescue KeyError or check hash.value?(value) first if a missing value is an expected case."],"exampleFix":"hash.key(value) if hash.value?(value) # verify the value exists first, or rescue KeyError around the lookup.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fde8e03a0a19da626576415223e4b002fc373967","analyzedAt":"2026-08-23T14:54:52.149Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}