Add error handling code and description