3 回答
TA贡献1815条经验 获得超13个赞
StandardError
Exception
Exception
rescue Exception
SyntaxError
, LoadError
Interrupt
.
Interrupt
SignalException
kill -9
.
SyntaxError
eval
kill
loop do begin sleep 1 eval "djsakru3924r9eiuorwju3498 += 5u84fior8u8t4ruyf8ihiure" rescue Exception puts "I refuse to fail or be stopped!" endend
Exception
begin # iceberg!rescue # lifeboatsend
Exception
StandardError
StandardError
Exception
变宽
StandardError
begin # iceberg!rescue => e # lifeboatsend
begin # iceberg!rescue StandardError => e # lifeboatsend
Exception
begin # iceberg?rescue Exception => e # do some logging raise e # not enough lifeboats ;)end
TA贡献1863条经验 获得超2个赞
eval
def turn_left self.turn left:end
SyntaxError
.
begin #... eval self.steering_wheel #...rescue Exception => e self.beep self.log "Caught #{e}.", : warn self.log "Logged Error - Continuing Process.", :infoend
哔声
警告:已捕获SyntaxError异常。
信息:记录错误-继续处理。
^C
: Interrupt
)
哔声
警告:捕获中断异常。
信息:记录错误-继续处理。
kill
SignalException
).
哔声
警告:捕获SignalException异常。
信息:记录错误-继续处理。
kill -9
rescue Exception => e
!
begin # do driving stuff rescue Exception => e self.airbags.inflate if self.exceeding_safe_stopping_momentum? raise end
Exception
只有当你重新引发异常的时候Exception
raise
ensure
ensure
begin # do driving stuff ensure self.airbags.inflate if self.exceeding_safe_stopping_momentum? end
rescue Exception => e
rescue Exception => e
- 3 回答
- 0 关注
- 876 浏览
添加回答
举报