Does Ruby's $! hold value only in rescue block?
$!
has the error in the rescue block, or in the the ensure block if there's no rescue block:
begin
raise 'foo'
ensure
puts $!.inspect # => #<RuntimeError: foo>
end
$!
has the value nil
everywhere else.