improved coffeescript error handling