Ignore exception message

[email protected]$G$9!#e(B

3.times{
Thread.new{
begin
sleep
ensure
p :foo # (A)
raise # (B)
end
}
}

e$B!!$3$s$J%W%m%0%i%`$r<B9T$9$k$H!"e(B(A) e$B$K$h$j!"e(B:foo
e$B$,e(B3e$B2sI=<($5$l$^$9!#e(B
e$B$7$+$7!"e(B(B) e$B$K$h$ke(B raise e$B$OL5;k$5$l$^$9!#e(B

e$B!!L5;k$5$l$k$N$OL5;k$5$l$k$N$G$$$$$N$G$9$,!"7Y9p$J$j%a%C%;!<%8$J$j$re(B
e$BI=<($7$J$/$F$b$$$$$b$s$G$7$g$&$+!Je(Bruby -d
e$B$G$OI=<($9$k$1$I!K!#$H$$$&e(B
e$B$+!“e(BPython
[email protected]$HI=<($7$F$$$?$N$G5$$K$J$j$^$7$?!#$7$+$b!”[email protected]$K$b!V$3e(B
e$B$N%(%i!<$OL5;k$9$k$h!<!W$H$$$&7Y9pIU$-!#e(B

def foo():
try:
yield 1
yield 2
finally:
raise RuntimeError

f = foo()
f.next()
f = foo()
f.next()

#=>
Exception exceptions.RuntimeError: RuntimeError() in <generator
object at 0x7ff2678c> ignored
Exception exceptions.RuntimeError: RuntimeError() in <generator
object at 0x7ff269ac> ignored

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:31561] ignore exception message”
on Tue, 21 Aug 2007 12:34:52 +0900, SASADA Koichi [email protected]
writes:

|e$B!!$3$s$J%W%m%0%i%`$r<B9T$9$k$H!"e(B(A) e$B$K$h$j!"e(B:foo e$B$,e(B3e$B2sI=<($5$l$^$9!#e(B
|e$B$7$+$7!"e(B(B) e$B$K$h$ke(B raise e$B$OL5;k$5$l$^$9!#e(B

Threade$BFbIt$G$NNc30$OL5;k$5$l$k$+$i$G$9$M!#e(B

|e$B!!L5;k$5$l$k$N$OL5;k$5$l$k$N$G$$$$$N$G$9$,!"7Y9p$J$j%a%C%;!<%8$J$j$re(B
|e$BI=<($7$J$/$F$b$$$$$b$s$G$7$g$&$+!Je(Bruby -d e$B$G$OI=<($9$k$1$I!K!#$H$$$&e(B
|e$B$+!“e(BPython [email protected]$HI=<($7$F$$$?$N$G5$$K$J$j$^$7$?!#$7$+$b!”[email protected]$K$b!V$3e(B
|e$B$N%(%i!<$OL5;k$9$k$h!<!W$H$$$&7Y9pIU$-!#e(B

Pythone$B$GL5;k$5$l$kM}M3$,$h$/$o$+$i$J$$$s$G$9$,e(B([email protected]$+e(B
e$B$i!)e(B)e$B!"e(BRubye$B$H$O;v>p$,0c$&$h$&$J5$$,$7$^$9!#e(BRubye$B$N>l9g$Oe(Bjoin
e$B$de(Bvaluee$B$GJaB*$G$-$^$9$7!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs