Added error handling to coffeescript generator.