handle exception thrown in greenlet