summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'error.c')
-rw-r--r--error.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/error.c b/error.c
index b9d8d52809..773d679e23 100644
--- a/error.c
+++ b/error.c
@@ -804,6 +804,15 @@ rb_exc_set_backtrace(VALUE exc, VALUE bt)
return exc_set_backtrace(exc, bt);
}
+/*
+ * call-seq:
+ * exception.cause -> an_exception
+ *
+ * Returns the previous exception ($!) at the time this exception was raised.
+ * This is useful for wrapping exceptions and retaining the original exception
+ * information.
+ */
+
VALUE
exc_cause(VALUE exc)
{