Add error handling sample code