Repository: reef Updated Branches: refs/heads/master fafc236bc -> 7e1ec477a
[REEF-2018] DataLakeFileSystem does not show adequate exception messages When there are errors in uploading and downloading, the ADLS file system constructs an error message using the error messages passed from the adls client. JIRA: [REEF-2018](https://issues.apache.org/jira/browse/REEF-2018) Pull Request: This closes #1462 Project: http://git-wip-us.apache.org/repos/asf/reef/repo Commit: http://git-wip-us.apache.org/repos/asf/reef/commit/7e1ec477 Tree: http://git-wip-us.apache.org/repos/asf/reef/tree/7e1ec477 Diff: http://git-wip-us.apache.org/repos/asf/reef/diff/7e1ec477 Branch: refs/heads/master Commit: 7e1ec477a04fb52d6c59bc94af69b507a155876f Parents: fafc236 Author: mandy shieh <mesh...@microsoft.com> Authored: Wed May 16 13:59:19 2018 -0700 Committer: Markus Weimer <wei...@apache.org> Committed: Wed May 30 07:38:52 2018 -0700 ---------------------------------------------------------------------- .../AzureDataLake/AzureDataLakeFileSystem.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/reef/blob/7e1ec477/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystem.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystem.cs b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystem.cs index 39d1f04..74dd70e 100644 --- a/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystem.cs +++ b/lang/cs/Org.Apache.REEF.IO/FileSystem/AzureDataLake/AzureDataLakeFileSystem.cs @@ -19,6 +19,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text; using Microsoft.Azure.DataLake.Store; using Microsoft.Azure.DataLake.Store.FileTransfer; using Org.Apache.REEF.Tang.Annotations; @@ -122,7 +123,13 @@ namespace Org.Apache.REEF.IO.FileSystem.AzureDataLake } if (status.EntriesFailed.Count != 0) { - throw new IOException($"{status.EntriesFailed.Count} entries did not get transferred correctly"); + var failedEntriesBuilder = new StringBuilder(); + for (int i = 0; i < status.EntriesFailed.Count && i < 50; i++) + { + var entry = status.EntriesFailed[i]; + failedEntriesBuilder.Append($"Entry {entry.EntryName} failed with error message {entry.Errors}. "); + } + throw new IOException($"{status.EntriesFailed.Count} entries failed to download. {failedEntriesBuilder.ToString()}"); } } @@ -135,7 +142,7 @@ namespace Org.Apache.REEF.IO.FileSystem.AzureDataLake TransferStatus status; try { - status = status = _adlsClient.BulkUpload(localFileName, remoteFileUri.AbsolutePath); + status = _adlsClient.BulkUpload(localFileName, remoteFileUri.AbsolutePath); } catch (Exception ex) { @@ -143,7 +150,13 @@ namespace Org.Apache.REEF.IO.FileSystem.AzureDataLake } if (status.EntriesFailed.Count != 0) { - throw new IOException($"{status.EntriesFailed.Count} entries did not get transferred correctly"); + var failedEntriesBuilder = new StringBuilder(); + for (int i = 0; i < status.EntriesFailed.Count && i < 50; i++) + { + var entry = status.EntriesFailed[i]; + failedEntriesBuilder.Append($"Entry {entry.EntryName} failed with error message {entry.Errors}. "); + } + throw new IOException($"{status.EntriesFailed.Count} entries failed to upload. {failedEntriesBuilder.ToString()}"); } }