Return callback when an error occurs