error handling function need parameters.