public static void ValidateDiagnosticInfos(DiagnosticInfoCollection response, IList request)
{
// returning an empty list for diagnostic info arrays is allowed.
if (response != null && response.Count != 0 && response.Count != request.Count)
{
throw new ServiceResultException(StatusCodes.BadUnexpectedError, "The server forgot to fill in the DiagnosticInfos array correctly when returning an operation level error.");
}
}