Error and resource exhaustion handling