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異常。
信息:記錄錯誤-繼續(xù)處理。
^C
: Interrupt
)
嗶聲
警告:捕獲中斷異常。
信息:記錄錯誤-繼續(xù)處理。
kill
SignalException
).
嗶聲
警告:捕獲SignalException異常。
信息:記錄錯誤-繼續(xù)處理。
kill -9
rescue Exception => e
!
begin # do driving stuff rescue Exception => e self.airbags.inflate if self.exceeding_safe_stopping_momentum? raise end
Exception
只有當你重新引發(fā)異常的時候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 關注
- 922 瀏覽
添加回答
舉報