ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:86528] [Ruby trunk Bug#14684] IRB swallows exceptions
       [not found] <redmine.issue-14684.20180412161830@ruby-lang.org>
@ 2018-04-12 16:18 ` msiegel
  2018-04-13  0:50 ` [ruby-core:86535] [Ruby trunk Bug#14684][Assigned] " hsbt
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: msiegel @ 2018-04-12 16:18 UTC (permalink / raw
  To: ruby-core

Issue #14684 has been reported by RubyBugs (A Nonymous).

----------------------------------------
Bug #14684: IRB swallows exceptions
https://bugs.ruby-lang.org/issues/14684

* Author: RubyBugs (A Nonymous)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-darwin15]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
# Summary

IRB swallows exceptions, doesn't provide programatic access to raised exception in session.

## Details

On Ruby 2.3.4, we find it surprising that exceptions in IRB are swallowed, and are not accessible at the two locations we checked:

1. In the global variable for most recent exception `$!`
2. In the return value of evaluating the expression `_`

Consider this IRB session:

~~~ ruby
def method_which_raises
  1/0
end

method_which_raises

# ZeroDivisionError: divided by 0
#	from (irb):10:in `/'
#	from (irb):10:in `method_which_raises'
#	from (irb):13
#	from /Users/marcsiegel/.rubies/ruby-2.3.4/bin/irb:11:in `<main>'
~~~

### Observed

Neither `_` nor `$!` give access to the raised exception, so that during development or debugging, one could dig further into what had occurred.

### Expected

Either `_` or `$!` would give programmatic access in IRB to an exception




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

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

* [ruby-core:86535] [Ruby trunk Bug#14684][Assigned] IRB swallows exceptions
       [not found] <redmine.issue-14684.20180412161830@ruby-lang.org>
  2018-04-12 16:18 ` [ruby-core:86528] [Ruby trunk Bug#14684] IRB swallows exceptions msiegel
@ 2018-04-13  0:50 ` hsbt
  2018-04-13  6:06 ` [ruby-core:86541] [Ruby trunk Bug#14684] " nobu
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: hsbt @ 2018-04-13  0:50 UTC (permalink / raw
  To: ruby-core

Issue #14684 has been updated by hsbt (Hiroshi SHIBATA).

Status changed from Open to Assigned
Assignee set to keiju (Keiju Ishitsuka)

----------------------------------------
Bug #14684: IRB swallows exceptions
https://bugs.ruby-lang.org/issues/14684#change-71474

* Author: RubyBugs (A Nonymous)
* Status: Assigned
* Priority: Normal
* Assignee: keiju (Keiju Ishitsuka)
* Target version: 
* ruby -v: ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-darwin15]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
# Summary

IRB swallows exceptions, doesn't provide programatic access to raised exception in session.

## Details

On Ruby 2.3.4, we find it surprising that exceptions in IRB are swallowed, and are not accessible at the two locations we checked:

1. In the global variable for most recent exception `$!`
2. In the return value of evaluating the expression `_`

Consider this IRB session:

~~~ ruby
def method_which_raises
  1/0
end

method_which_raises

# ZeroDivisionError: divided by 0
#	from (irb):10:in `/'
#	from (irb):10:in `method_which_raises'
#	from (irb):13
#	from /Users/marcsiegel/.rubies/ruby-2.3.4/bin/irb:11:in `<main>'
~~~

### Observed

Neither `_` nor `$!` give access to the raised exception, so that during development or debugging, one could dig further into what had occurred.

### Expected

Either `_` or `$!` would give programmatic access in IRB to an exception




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

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

* [ruby-core:86541] [Ruby trunk Bug#14684] IRB swallows exceptions
       [not found] <redmine.issue-14684.20180412161830@ruby-lang.org>
  2018-04-12 16:18 ` [ruby-core:86528] [Ruby trunk Bug#14684] IRB swallows exceptions msiegel
  2018-04-13  0:50 ` [ruby-core:86535] [Ruby trunk Bug#14684][Assigned] " hsbt
@ 2018-04-13  6:06 ` nobu
  2018-04-13 14:24 ` [ruby-core:86542] [Ruby trunk Feature#14684] " msiegel
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: nobu @ 2018-04-13  6:06 UTC (permalink / raw
  To: ruby-core

Issue #14684 has been updated by nobu (Nobuyoshi Nakada).


`$!` isn't accessible outside `rescue` clause, even without irb.

----------------------------------------
Bug #14684: IRB swallows exceptions
https://bugs.ruby-lang.org/issues/14684#change-71479

* Author: RubyBugs (A Nonymous)
* Status: Assigned
* Priority: Normal
* Assignee: keiju (Keiju Ishitsuka)
* Target version: 
* ruby -v: ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-darwin15]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
# Summary

IRB swallows exceptions, doesn't provide programatic access to raised exception in session.

## Details

On Ruby 2.3.4, we find it surprising that exceptions in IRB are swallowed, and are not accessible at the two locations we checked:

1. In the global variable for most recent exception `$!`
2. In the return value of evaluating the expression `_`

Consider this IRB session:

~~~ ruby
def method_which_raises
  1/0
end

method_which_raises

# ZeroDivisionError: divided by 0
#	from (irb):10:in `/'
#	from (irb):10:in `method_which_raises'
#	from (irb):13
#	from /Users/marcsiegel/.rubies/ruby-2.3.4/bin/irb:11:in `<main>'
~~~

### Observed

Neither `_` nor `$!` give access to the raised exception, so that during development or debugging, one could dig further into what had occurred.

### Expected

Either `_` or `$!` would give programmatic access in IRB to an exception




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

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

* [ruby-core:86542] [Ruby trunk Feature#14684] IRB swallows exceptions
       [not found] <redmine.issue-14684.20180412161830@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2018-04-13  6:06 ` [ruby-core:86541] [Ruby trunk Bug#14684] " nobu
@ 2018-04-13 14:24 ` msiegel
  2018-04-17 13:35 ` [ruby-core:86558] " msiegel
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: msiegel @ 2018-04-13 14:24 UTC (permalink / raw
  To: ruby-core

Issue #14684 has been updated by RubyBugs (A Nonymous).


nobu (Nobuyoshi Nakada) wrote:
> `$!` isn't accessible outside `rescue` clause, even without irb.

In IRB, should `$!` be set, or a proxy for it be set, when the IRB eval handles an exception?

----------------------------------------
Feature #14684: IRB swallows exceptions
https://bugs.ruby-lang.org/issues/14684#change-71482

* Author: RubyBugs (A Nonymous)
* Status: Assigned
* Priority: Normal
* Assignee: keiju (Keiju Ishitsuka)
* Target version: 
----------------------------------------
# Summary

IRB swallows exceptions, doesn't provide programatic access to raised exception in session.

## Details

On Ruby 2.3.4, we find it surprising that exceptions in IRB are swallowed, and are not accessible at the two locations we checked:

1. In the global variable for most recent exception `$!`
2. In the return value of evaluating the expression `_`

Consider this IRB session:

~~~ ruby
def method_which_raises
  1/0
end

method_which_raises

# ZeroDivisionError: divided by 0
#	from (irb):10:in `/'
#	from (irb):10:in `method_which_raises'
#	from (irb):13
#	from /Users/marcsiegel/.rubies/ruby-2.3.4/bin/irb:11:in `<main>'
~~~

### Observed

Neither `_` nor `$!` give access to the raised exception, so that during development or debugging, one could dig further into what had occurred.

### Expected

Either `_` or `$!` would give programmatic access in IRB to an exception




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

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

* [ruby-core:86558] [Ruby trunk Feature#14684] IRB swallows exceptions
       [not found] <redmine.issue-14684.20180412161830@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2018-04-13 14:24 ` [ruby-core:86542] [Ruby trunk Feature#14684] " msiegel
@ 2018-04-17 13:35 ` msiegel
  2018-04-17 14:11 ` [ruby-core:86559] " nobu
  2018-04-17 17:07 ` [ruby-core:86565] " msiegel
  6 siblings, 0 replies; 7+ messages in thread
From: msiegel @ 2018-04-17 13:35 UTC (permalink / raw
  To: ruby-core

Issue #14684 has been updated by RubyBugs (A Nonymous).


@nobu:

Would it be possible to back-port this to Ruby 2.3, 2.4, and 2.5?

Or, would you be willing to review patches from me to back-port this?

----------------------------------------
Feature #14684: IRB swallows exceptions
https://bugs.ruby-lang.org/issues/14684#change-71500

* Author: RubyBugs (A Nonymous)
* Status: Closed
* Priority: Normal
* Assignee: keiju (Keiju Ishitsuka)
* Target version: 
----------------------------------------
# Summary

IRB swallows exceptions, doesn't provide programatic access to raised exception in session.

## Details

On Ruby 2.3.4, we find it surprising that exceptions in IRB are swallowed, and are not accessible at the two locations we checked:

1. In the global variable for most recent exception `$!`
2. In the return value of evaluating the expression `_`

Consider this IRB session:

~~~ ruby
def method_which_raises
  1/0
end

method_which_raises

# ZeroDivisionError: divided by 0
#	from (irb):10:in `/'
#	from (irb):10:in `method_which_raises'
#	from (irb):13
#	from /Users/marcsiegel/.rubies/ruby-2.3.4/bin/irb:11:in `<main>'
~~~

### Observed

Neither `_` nor `$!` give access to the raised exception, so that during development or debugging, one could dig further into what had occurred.

### Expected

Either `_` or `$!` would give programmatic access in IRB to an exception




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

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

* [ruby-core:86559] [Ruby trunk Feature#14684] IRB swallows exceptions
       [not found] <redmine.issue-14684.20180412161830@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2018-04-17 13:35 ` [ruby-core:86558] " msiegel
@ 2018-04-17 14:11 ` nobu
  2018-04-17 17:07 ` [ruby-core:86565] " msiegel
  6 siblings, 0 replies; 7+ messages in thread
From: nobu @ 2018-04-17 14:11 UTC (permalink / raw
  To: ruby-core

Issue #14684 has been updated by nobu (Nobuyoshi Nakada).


I changed the tracker to "Feature", as I thought it would not need to backport.
But branch maintainers may have different opinion.
It seems easy to apply the commits to the old branches.

----------------------------------------
Feature #14684: IRB swallows exceptions
https://bugs.ruby-lang.org/issues/14684#change-71501

* Author: RubyBugs (A Nonymous)
* Status: Closed
* Priority: Normal
* Assignee: keiju (Keiju Ishitsuka)
* Target version: 
----------------------------------------
# Summary

IRB swallows exceptions, doesn't provide programatic access to raised exception in session.

## Details

On Ruby 2.3.4, we find it surprising that exceptions in IRB are swallowed, and are not accessible at the two locations we checked:

1. In the global variable for most recent exception `$!`
2. In the return value of evaluating the expression `_`

Consider this IRB session:

~~~ ruby
def method_which_raises
  1/0
end

method_which_raises

# ZeroDivisionError: divided by 0
#	from (irb):10:in `/'
#	from (irb):10:in `method_which_raises'
#	from (irb):13
#	from /Users/marcsiegel/.rubies/ruby-2.3.4/bin/irb:11:in `<main>'
~~~

### Observed

Neither `_` nor `$!` give access to the raised exception, so that during development or debugging, one could dig further into what had occurred.

### Expected

Either `_` or `$!` would give programmatic access in IRB to an exception




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

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

* [ruby-core:86565] [Ruby trunk Feature#14684] IRB swallows exceptions
       [not found] <redmine.issue-14684.20180412161830@ruby-lang.org>
                   ` (5 preceding siblings ...)
  2018-04-17 14:11 ` [ruby-core:86559] " nobu
@ 2018-04-17 17:07 ` msiegel
  6 siblings, 0 replies; 7+ messages in thread
From: msiegel @ 2018-04-17 17:07 UTC (permalink / raw
  To: ruby-core

Issue #14684 has been updated by RubyBugs (A Nonymous).


Hmm. Our hope would be to have this "easy" change back-ported to 2.3, 2.4, and 2.5 -- waiting until December to have it in final 2.6 seems a long time to wait for this? Please let us know how we can help.

----------------------------------------
Feature #14684: IRB swallows exceptions
https://bugs.ruby-lang.org/issues/14684#change-71505

* Author: RubyBugs (A Nonymous)
* Status: Closed
* Priority: Normal
* Assignee: keiju (Keiju Ishitsuka)
* Target version: 
----------------------------------------
# Summary

IRB swallows exceptions, doesn't provide programatic access to raised exception in session.

## Details

On Ruby 2.3.4, we find it surprising that exceptions in IRB are swallowed, and are not accessible at the two locations we checked:

1. In the global variable for most recent exception `$!`
2. In the return value of evaluating the expression `_`

Consider this IRB session:

~~~ ruby
def method_which_raises
  1/0
end

method_which_raises

# ZeroDivisionError: divided by 0
#	from (irb):10:in `/'
#	from (irb):10:in `method_which_raises'
#	from (irb):13
#	from /Users/marcsiegel/.rubies/ruby-2.3.4/bin/irb:11:in `<main>'
~~~

### Observed

Neither `_` nor `$!` give access to the raised exception, so that during development or debugging, one could dig further into what had occurred.

### Expected

Either `_` or `$!` would give programmatic access in IRB to an exception




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

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

end of thread, other threads:[~2018-04-17 17:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-14684.20180412161830@ruby-lang.org>
2018-04-12 16:18 ` [ruby-core:86528] [Ruby trunk Bug#14684] IRB swallows exceptions msiegel
2018-04-13  0:50 ` [ruby-core:86535] [Ruby trunk Bug#14684][Assigned] " hsbt
2018-04-13  6:06 ` [ruby-core:86541] [Ruby trunk Bug#14684] " nobu
2018-04-13 14:24 ` [ruby-core:86542] [Ruby trunk Feature#14684] " msiegel
2018-04-17 13:35 ` [ruby-core:86558] " msiegel
2018-04-17 14:11 ` [ruby-core:86559] " nobu
2018-04-17 17:07 ` [ruby-core:86565] " msiegel

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).