Added error handling tests and example to readme