Actions
Bug #10635
closedcmp_failed warnings in 2.2 are very hard to track down
Description
I propose we add the exception (and possibly backtrace as well) to show the root cause of the warning.
diff --git a/compar.c b/compar.c
index 81dff38..70d08ca 100644
--- a/compar.c
+++ b/compar.c
@@ -68,10 +68,11 @@ cmp_eq(VALUE *a)
}
static VALUE
-cmp_failed(void)
+cmp_failed(VALUE args, VALUE exception_object)
{
rb_warn("Comparable#== will no more rescue exceptions of #<=> in the next release.");
rb_warn("Return nil in #<=> if the comparison is inappropriate or avoid such comparison.");
+ rb_warn("Exception: %"PRIsVALUE, rb_inspect(exception_object));
return Qfalse;
}
cc #7688
Updated by jeremyevans0 (Jeremy Evans) almost 5 years ago
- Status changed from Open to Closed
cmp_failed
was removed in Ruby 2.3.
Actions
Like0
Like0Like0