Add documentation on error handling