add on_error functionality to README.md