Adding documentation on error handling