{"record":{"id":"60ec5700416a717d","repo":"sds/overcommit","slug":"unexpected-output-invalid-line-number-found-in","errorCode":null,"errorMessage":"Unexpected output: invalid line number found in '#{message}'","messagePattern":"Unexpected output: invalid line number found in '#(.+?)'","errorType":"exception","errorClass":"Overcommit::Exceptions::MessageProcessingError","httpStatus":null,"severity":"error","filePath":"lib/overcommit/utils/messages_utils.rb","lineNumber":58,"sourceCode":"      private\n\n      def extract_file(match, message)\n        return unless match.names.include?('file')\n\n        if match[:file].to_s.empty?\n          raise Overcommit::Exceptions::MessageProcessingError,\n                \"Unexpected output: no file found in '#{message}'\"\n        end\n\n        match[:file]\n      end\n\n      def extract_line(match, message)\n        return unless match.names.include?('line')\n\n        Integer(match[:line])\n      rescue ArgumentError, TypeError\n        raise Overcommit::Exceptions::MessageProcessingError,\n              \"Unexpected output: invalid line number found in '#{message}'\"\n      end\n\n      def extract_type(match, message, type_categorizer)\n        if type_categorizer\n          type_match = match.names.include?('type') ? match[:type] : nil\n          type = type_categorizer.call(type_match)\n          unless Overcommit::Hook::MESSAGE_TYPES.include?(type)\n            raise Overcommit::Exceptions::MessageProcessingError,\n                  \"Invalid message type '#{type}' for '#{message}': must \" \\\n                  \"be one of #{Overcommit::Hook::MESSAGE_TYPES.inspect}\"\n          end\n          type\n        else\n          :error # Assume error since no categorizer was defined\n        end\n      end\n    end","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/sds/overcommit/blob/fee0cd74b26eb81f64b43b7fab17bbb541575cc4/lib/overcommit/utils/messages_utils.rb#L40-L76","documentation":"Error \"Unexpected output: invalid line number found in '#{message}'\" thrown in sds/overcommit.","triggerScenarios":"Thrown at lib/overcommit/utils/messages_utils.rb:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the line-number field of each tool output line is a valid integer.","Adjust the tool's output format or the hook's parsing regex so line numbers are extracted as numeric values."],"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"}