Add error handling and logging to the example
gendocs