public static void CheckValidPath(string path) { PathResult result = IsValidPath(path); if (result == PathResult.Correct) return; throw GetInvalidPathException(result, path); }