Mega Code Archive

 
Categories / Ruby / Statement
 

Rescues syntax makes handling different exceptions in different ways easy

begin   ... code here ... rescue ZeroDivisionError   ... code to rescue the zero division exception here ... rescue YourOwnException   ... code to rescue a different type of exception here ... rescue   ... code that rescues all other types of exception here ... end