<PackageReference Include="Relativity.Server.Transfer.SDK" Version="24000.0.1" />

FileshareErrorHelper

using Relativity.Transfer.FileShare.Resources; using System; using System.IO; namespace Relativity.Transfer.FileShare { internal class FileshareErrorHelper { public static string GetErrorMessage(Exception exception) { if (exception is ArgumentException) return FileShareStrings.TransferCommandArgumentExceptionMessage; if (exception is PathTooLongException) return FileShareStrings.TransferCommandLongPathExceptionMessage; if (exception is IOException) { if (IsDiskFull(exception)) return FileShareStrings.TransferCommandDiskFullExceptionMessage; return FileShareStrings.TransferCommandOverwriteExceptionMessage; } if (exception is NotSupportedException) return FileShareStrings.TransferCommandInvalidFormatExceptionMessage; return exception.Message; } public static string GetErrorMessage(TransferPath path, Exception exception) { string text = GetErrorMessage(exception); if (exception is FileNotFoundException) { text = FileShareStrings.TransferCommandFileNotFoundCheckLogs; if (path.SourcePath.Length >= 260) text += FileShareStrings.LongPathWarningMessage; return text; } if (exception is DirectoryNotFoundException && !string.IsNullOrEmpty(path.TargetPath) && path.TargetPath.Length >= 260) text += FileShareStrings.LongPathWarningMessage; return text; } public static bool IsDiskFull(Exception ex) { if (ex.HResult != -2147024857) return ex.HResult == -2147024784; return true; } } }