update error handling mechanism