ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:62984] [ruby-trunk - Feature #9918] [Open] Exception#cause should be shown in output and #inspect
       [not found] <redmine.issue-9918.20140607125811@ruby-lang.org>
@ 2014-06-07 12:58 ` eregontp
  2015-07-13 14:32 ` [ruby-core:69957] [Ruby trunk - Feature #9918] " nobu
  1 sibling, 0 replies; 2+ messages in thread
From: eregontp @ 2014-06-07 12:58 UTC (permalink / raw)
  To: ruby-core

Issue #9918 has been reported by Benoit Daloze.

----------------------------------------
Feature #9918: Exception#cause should be shown in output and #inspect
https://bugs.ruby-lang.org/issues/9918

* Author: Benoit Daloze
* Status: Open
* Priority: Normal
* Assignee: 
* Category: core
* Target version: current: 2.2.0
----------------------------------------
Exception#cause has been added in Feature #8257.
But the cause is never shown, one needs to inspect exc.cause to know the cause.

The cause should be shown by default, for instance:

    begin
      raise "cause"
    rescue
      raise "wrapper"
    end

Should output:

    -:4:in `rescue in <main>': wrapper (RuntimeError)
           from -:1:in `<main>'
    Caused by:
    -e:1:in `<main>': org (RuntimeError)

And not only the first 2 lines.
Logically, #inspect should also include the cause such as:

    #<RuntimeError: wrapper cause:#<RuntimeError: org>>

What do you think?



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ruby-core:69957] [Ruby trunk - Feature #9918] Exception#cause should be shown in output and #inspect
       [not found] <redmine.issue-9918.20140607125811@ruby-lang.org>
  2014-06-07 12:58 ` [ruby-core:62984] [ruby-trunk - Feature #9918] [Open] Exception#cause should be shown in output and #inspect eregontp
@ 2015-07-13 14:32 ` nobu
  1 sibling, 0 replies; 2+ messages in thread
From: nobu @ 2015-07-13 14:32 UTC (permalink / raw)
  To: ruby-core

Issue #9918 has been updated by Nobuyoshi Nakada.

Description updated

----------------------------------------
Feature #9918: Exception#cause should be shown in output and #inspect
https://bugs.ruby-lang.org/issues/9918#change-53387

* Author: Benoit Daloze
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Exception#cause has been added in Feature #8257.
But the cause is never shown, one needs to inspect exc.cause to know the cause.

The cause should be shown by default, for instance:

~~~ruby
begin
  raise "cause"
rescue
  raise "wrapper"
end
~~~

Should output:

    -:4:in `rescue in <main>': wrapper (RuntimeError)
           from -:1:in `<main>'
    Caused by:
    -e:1:in `<main>': org (RuntimeError)

And not only the first 2 lines.
Logically, #inspect should also include the cause such as:

    #<RuntimeError: wrapper cause:#<RuntimeError: org>>

What do you think?



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-13 14:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-9918.20140607125811@ruby-lang.org>
2014-06-07 12:58 ` [ruby-core:62984] [ruby-trunk - Feature #9918] [Open] Exception#cause should be shown in output and #inspect eregontp
2015-07-13 14:32 ` [ruby-core:69957] [Ruby trunk - Feature #9918] " nobu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).