Tell the client immediately when it becomes apparent that there is a problem! Discuss what you can do for them. See how (or if) they want to proceed.
This is the general process for any kind of failure to deliver.