catch exception for begin invoke