'Check exception propagation from nested functions.'

def check_raise_nested(self, **jit_args):

    inner_pyfunc = raise_instance(MyError, 'some    message')
    inner_cfunc = jit(**jit_args)(inner_pyfunc)
    cfunc = jit(**jit_args)(outer_function(inner_cfunc))
    with self.assertRaises(MyError) as cm:
        cfunc(1)
    self.assertEqual(cm.exception.args, ('some    message', 1))
    with self.assertRaises(ValueError) as cm:
        cfunc(2)
    self.assertEqual(cm.exception.args, ('some    message', 2))
    with self.assertRaises(OtherError) as cm:
        cfunc(3)
    self.assertEqual(cm.exception.args, ('bar', 3))
