{"record":{"id":"047c983f92750ff4","repo":"faker-ruby/faker","slug":"length-should-be-9-or-14","errorCode":null,"errorMessage":"Length should be 9 or 14","messagePattern":"Length should be 9 or 14","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/faker/default/company.rb","lineNumber":326,"sourceCode":"        loop do\n          result = Array.new(3) { rand(1..9) } + Array.new(7) { rand(10) }\n          break if (weight_sum(result, weights) % 11) == result[9]\n        end\n        result.join\n      end\n\n      ##\n      # Produces a company polish register of national economy.\n      #\n      # @return [String]\n      #\n      # @example\n      #   Faker::Company.polish_register_of_national_economy #=> \"788435970\"\n      #\n      # @faker.version 1.9.1\n      # Get a random Polish register of national economy number. More info https://pl.wikipedia.org/wiki/REGON\n      def polish_register_of_national_economy(length: 9)\n        raise ArgumentError, 'Length should be 9 or 14' unless [9, 14].include? length\n\n        random_digits = []\n        loop do\n          random_digits = Array.new(length) { rand(10) }\n          break if collect_regon_sum(random_digits) == random_digits.last\n        end\n        random_digits.join\n      end\n\n      ##\n      # Produces a company south african pty ltd registration number.\n      #\n      # @return [String]\n      #\n      # @example\n      #   Faker::Company.south_african_pty_ltd_registration_number #=> \"7043/2400717902/07\"\n      #\n      # @faker.version 1.9.2","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/faker-ruby/faker/blob/cca4184947e09fdd02afb8b89d25a9c8ebc7274e/lib/faker/default/company.rb#L308-L344","documentation":"Error \"Length should be 9 or 14\" thrown in faker-ruby/faker.","triggerScenarios":"Thrown at lib/faker/default/company.rb:326 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":"cca4184947e09fdd02afb8b89d25a9c8ebc7274e","analyzedAt":"2026-08-21T16:25:39.145Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}