Actions
Bug #10635
closedcmp_failed warnings in 2.2 are very hard to track down
    Bug #10635:
    cmp_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
Actions