Add error handling to examples in README.md