add err handler
Merge pull request #1 from wenbing/master

add err handler