private bool TryGetErrorFile(Guid guid, out FileInfo file) { string[] fileList = Directory.GetFiles(_path, string.Format("*{0}.json", guid.ToFileName())); if (fileList.Length != 1) { file = null; return false; } file = new FileInfo(fileList[0]); return true; }
/// <summary> /// Gets the error with the specified guid from the log/folder /// </summary> /// <param name="guid">The guid of the error to retrieve</param> /// <returns>The error object if found, null otherwise</returns> protected override Error GetError(Guid guid) { string[] fileList = Directory.GetFiles(_path, string.Format("*{0}.json", guid.ToFileName())); if (fileList.Length < 1) return null; return Get(fileList[0]); }