Add error handling to the examples
gendocs