Do not rescue Exception. Exception is super base class of ruby's error including NoMemoryError, SyntaxError. 
`rescue => e` should be fine.