------ art_843_31220540.1326731502714
Content-Type: multipart/alternative;
boundary --- art_844_32970456.1326731502714"
------ art_844_32970456.1326731502714
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
This question might be a bit technical with regards to the inner workings
of Ruby. (I considered posint to ruby-core) but hopefully here someone will
know.
Whittling it down to the essentials, I am wondering if it is safe to raise
the same error instance multiple times.
$ANERROR untimeError.new
def foo(var)
begin
raise $ANERROR, "dynamic message here #{var}" if var.says_so?
rescue
recorded_errors << var
end
end
The function in itself doesn't matter, that's just a silly example. The
main thing is the re-raising of a single instance of the error class, in
this example $ANERROR.
------ art_844_32970456.1326731502714
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
This question might be a bit technical with regards to the inner workings of Ruby. (I considered posint to ruby-core) but hopefully here someone will know.<br><br>Whittling it down to the essentials, I am wondering if it is safe to raise the same error instance multiple times.<br><br> $ANERROR untimeError.new<br><br> def foo(var)<br> begin<br> raise $ANERROR, "dynamic message here #{var}" if var.says_so?<br> rescue<br> recorded_errors << var<br> end<br> end<br><br>The function in itself doesn't matter, that's just a silly example. The main thing is the re-raising of a single instance of the error class, in this example $ANERROR.<br><br>
------ art_844_32970456.1326731502714--
------ art_843_31220540.1326731502714--