{"record":{"id":"b76953f190d45146","repo":"flippercloud/flipper","slug":"value-inspect-cannot-be-converted-to-a-set","errorCode":null,"errorMessage":"#{value.inspect} cannot be converted to a set","messagePattern":"#(.+?) cannot be converted to a set","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/flipper/typecast.rb","lineNumber":72,"sourceCode":"        value.to_f\n      end\n    rescue NoMethodError\n      raise ArgumentError, \"#{value.inspect} cannot be converted to a number\"\n    end\n    singleton_class.send(:alias_method, :to_percentage, :to_number)\n\n    # Internal: Convert value to a set.\n    #\n    # Returns a Set representation of the value.\n    # Raises ArgumentError if conversion is not possible.\n    def self.to_set(value)\n      return value if value.is_a?(Set)\n      return Set.new if value.nil? || value.empty?\n\n      if value.respond_to?(:to_set)\n        value.to_set\n      else\n        raise ArgumentError, \"#{value.inspect} cannot be converted to a set\"\n      end\n    end\n\n    # Internal: Convert value to a feature name usable as a feature key.\n    # Removes invisible format/control characters (zero-width spaces,\n    # joiners, BOM, etc.) that make visually identical but distinct names,\n    # and trims unicode whitespace (e.g. non-breaking space) that\n    # String#strip misses. Visible characters are left untouched.\n    #\n    # Returns a String.\n    def self.to_feature_name(value)\n      # U+2800 renders as a fixed-width blank but is not default-ignorable or whitespace.\n      value.to_s\n           .scrub('')\n           .gsub(/[\\p{Default_Ignorable_Code_Point}\\p{Cc}\\u2800]/, '')\n           .gsub(/\\A[[:space:]]+|[[:space:]]+\\z/, '')\n    end\n","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/flippercloud/flipper/blob/1f86de3ec91521585b156445e156642938b19cb0/lib/flipper/typecast.rb#L54-L90","documentation":"Error \"#{value.inspect} cannot be converted to a set\" thrown in flippercloud/flipper.","triggerScenarios":"Thrown at lib/flipper/typecast.rb:72 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an Array, Set, or delimited String; other types cannot be converted to a Set","Convert with Array(value) or value.split(',') before passing to Flipper","Check the value type coming from your adapter or request params"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1f86de3ec91521585b156445e156642938b19cb0","analyzedAt":"2026-08-23T04:36:09.896Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}