{"record":{"id":"0ff49fa9393ea36f","repo":"faker-ruby/faker","slug":"could-not-find-iban-details-for-country-code","errorCode":null,"errorMessage":"Could not find iban details for #{country_code}","messagePattern":"Could not find iban details for #(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/faker/default/bank.rb","lineNumber":44,"sourceCode":"      # @param country_code [String, nil] Specifies what country prefix is used to generate the iban code. Providing `nil` will use a random country.\n      # @return [String]\n      #\n      # @example\n      #   Faker::Bank.iban #=> \"GB76DZJM33188515981979\"\n      #   Faker::Bank.iban(country_code: \"be\") #=> \"BE6375388567752043\"\n      #   Faker::Bank.iban(country_code: nil) #=> \"DE45186738071857270067\"\n      #\n      # @faker.version 1.7.0\n      def iban(country_code: 'GB')\n        # Each country has its own format for bank accounts\n        # Many of them use letters in certain parts of the account\n        # Using regex patterns we can create virtually any type of bank account\n        country_code ||= iban_country_code\n\n        begin\n          pattern = fetch(\"bank.iban_details.#{country_code.downcase}.bban_pattern\")\n        rescue I18n::MissingTranslationData\n          raise ArgumentError, \"Could not find iban details for #{country_code}\"\n        end\n\n        # Use Faker::Base.regexify for creating a sample from bank account format regex\n        account = Base.regexify(/#{pattern}/)\n\n        # Add country code and checksum to the generated account to form valid IBAN\n        country_code.upcase + iban_checksum(country_code, account) + account\n      end\n\n      ##\n      # Produces the ISO 3166 code of a country that uses the IBAN system.\n      #\n      # @return [String]\n      #\n      # @example\n      #   Faker::Bank.iban_country_code #=> \"CH\"\n      #\n      # @faker.version next","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/faker-ruby/faker/blob/cca4184947e09fdd02afb8b89d25a9c8ebc7274e/lib/faker/default/bank.rb#L26-L62","documentation":"Error \"Could not find iban details for #{country_code}\" thrown in faker-ruby/faker.","triggerScenarios":"Thrown at lib/faker/default/bank.rb:44 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"}