add custom parse error handler.

http://qiita.com/ryoppy@github/items/d8555723547db56a6a0d
Merge pull request #7 from xuwei-k/custom-parse-error-handler

add custom parse error handler.