ONERROR safety check