diff --git a/src/DataLakeStore/DataLakeStore/ChangeLog.md b/src/DataLakeStore/DataLakeStore/ChangeLog.md index 36f7827b628d..b8f0666eb821 100644 --- a/src/DataLakeStore/DataLakeStore/ChangeLog.md +++ b/src/DataLakeStore/DataLakeStore/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Throw exception for Import-AzDataLakeStoreItem, Export-AzDataLakeStoreItem for store side exceptions. Earlier it used to write in the console. ## Version 1.2.7 * Added reference to System.Buffers explicitly in csproj and psd1. diff --git a/src/DataLakeStore/DataLakeStore/DataPlaneModels/DataLakeStoreFileSystemClient.cs b/src/DataLakeStore/DataLakeStore/DataPlaneModels/DataLakeStoreFileSystemClient.cs index c6c41bd7050b..904f0c227376 100644 --- a/src/DataLakeStore/DataLakeStore/DataPlaneModels/DataLakeStoreFileSystemClient.cs +++ b/src/DataLakeStore/DataLakeStore/DataPlaneModels/DataLakeStoreFileSystemClient.cs @@ -724,9 +724,14 @@ public void BulkCopy(string destinationFolderPath, string accountName, string so UpdateProgress(progress, cmdletRunningRequest); if (status != null && cmdletRunningRequest != null) { - foreach (var failedEntry in status.EntriesFailed) + if (status.EntriesFailed.Count > 0) { - cmdletRunningRequest.WriteObject($"FailedTransfer: {failedEntry.EntryName} {failedEntry.Errors}"); + string error = ""; + foreach (var failedEntry in status.EntriesFailed) + { + error+=$"FailedTransfer: Name- {failedEntry.EntryName}, Type- {failedEntry.Type}, Status- {failedEntry.Status}, Error- {failedEntry.Errors}"; + } + throw new AdlsException(error); } } }