Project

General

Profile

Actions

Feature #6286

closed

Add Exception#format method

Added by vo.x (Vit Ondruch) almost 12 years ago. Updated over 4 years ago.

Status:
Closed
Target version:
-
[ruby-core:44328]

Description

It would be nice if Exception class could be extended by #format method (or method with some more suitable name), which would provide the same formatting as is standard output of Ruby exception, e.g.

boomtest.rb:18:in go': boom (RuntimeError) from boomtest.rb:34:in foo'
from boomtest.rb:36

Currently, this formatting is done by error_print function from eval_error.c. Unfortunately this method is just Ruby's internal.

Please note that there exists exception_string gem, which add similar method [1] to the Exception class.

[1] https://github.com/raggi/exception_string/blob/master/lib/exception_string.rb#L15-19


Files

0001-Feature-6286.patch (11.5 KB) 0001-Feature-6286.patch nobu (Nobuyoshi Nakada), 04/16/2012 08:57 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0