added error handling to docs