[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

-d option prints exceptions to stderr

Jim Freeze

9/8/2003 8:48:00 PM

Hi

Is printing internal exceptions (even those that are caught)
to stderr in debug mode a new feature of 1.8?

irb -d
irb(main):001:0> def to_num(str)
irb(main):002:1> Integer(str) rescue Float(str)
irb(main):003:1> end
=> nil
irb(main):004:0> to_num("0.25")
Exception `ArgumentError' at (irb):2 - invalid value for Integer: "0.25"
=> 0.25
irb(main):005:0>


irb
irb(main):001:0> def to_num(str)
irb(main):002:1> Integer(str) rescue Float(str)
irb(main):003:1> end
=> nil
irb(main):004:0> to_num("0.25")
=> 0.25
irb(main):005:0>

--
Jim Freeze
----------
One Page Principle:
A specification that will not fit on one page of 8.5x11 inch
paper cannot be understood.
-- Mark Ardis

2 Answers

nobu.nokada

9/9/2003 1:31:00 AM

0

Hi,

At Tue, 9 Sep 2003 05:48:16 +0900,
Jim Freeze wrote:
> Is printing internal exceptions (even those that are caught)
> to stderr in debug mode a new feature of 1.8?

No.

$ ruby-1.4 -v -d -e ''begin raise; rescue; end''
ruby 1.4.6 (2000-08-16) [i686-linux]
Exception `RuntimeError'' at /tmp/rbOACz4X:1

--
Nobu Nakada

matz

9/9/2003 3:26:00 AM

0

Hi,

In message "-d option prints exceptions to stderr"
on 03/09/09, Jim Freeze <jim@freeze.org> writes:

|Is printing internal exceptions (even those that are caught)
|to stderr in debug mode a new feature of 1.8?

No.

matz.