fix scope error catch, add a doc.