Error handling function structure.