Skip to content

Commit 7adcacb

Browse files
committed
Update exception message to match MRI.
1 parent 2a92931 commit 7adcacb

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/main/ruby/core/type.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -567,11 +567,8 @@ def self.compatible_encoding(a, b)
567567
unless enc
568568
enc_a = object_encoding a
569569
enc_b = object_encoding b
570-
message = +'undefined conversion '
571-
message << "for '#{a.inspect}' " if object_kind_of?(a, String)
572-
message << "from #{enc_a} to #{enc_b}"
573570

574-
raise Encoding::CompatibilityError, message
571+
raise Encoding::CompatibilityError, "incompatible character encodings: #{enc_a} and #{enc_b}"
575572
end
576573

577574
enc

0 commit comments

Comments
 (0)