diff options
| author | John Hawthorn <john@hawthorn.email> | 2026-02-21 21:32:51 -0800 |
|---|---|---|
| committer | John Hawthorn <john@hawthorn.email> | 2026-02-24 15:53:34 -0800 |
| commit | c5d85d5ab0c317ecbf2054e98ce203ffdc148e4f (patch) | |
| tree | d7c4572e2ee459fa5102cb36515e756d290fe8ff /bootstraptest | |
| parent | f1c2fafa0c4394f15927cc9238de970e6970a42d (diff) | |
Improve error message failing to copy proc
Previously, when passing an unshareable proc to a Ractor we would get
the message:
'Ractor.new': allocator undefined for Proc (TypeError)
With this change we get:
'Ractor.new': can not copy unshareable object #<Proc:0x00007f1b31713600 test.rb:2> (Ractor::Error)
Which should hopefully be a little clearer about the problem and make it
simpler to debug.
Diffstat (limited to 'bootstraptest')
| -rw-r--r-- | bootstraptest/test_ractor.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb index 9242dce7dc..08f9b73c13 100644 --- a/bootstraptest/test_ractor.rb +++ b/bootstraptest/test_ractor.rb @@ -507,14 +507,14 @@ assert_equal 'false', %q{ } # To copy the object, now Marshal#dump is used -assert_equal "allocator undefined for Thread", %q{ +assert_match /can not copy unshareable object/, %q{ obj = Thread.new{} begin r = Ractor.new obj do |msg| msg end - rescue TypeError => e - e.message #=> no _dump_data is defined for class Thread + rescue Ractor::Error => e + e.message else 'ng' end |
