Skip to content

Commit

Permalink
[wasm] WasmAppBuilder: log IO exceptions when copying files, as errors
Browse files Browse the repository at this point in the history
inspired by dotnet#61081
  • Loading branch information
radical committed Nov 7, 2021
1 parent f10fe15 commit 7e433fb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/tasks/WasmAppBuilder/WasmAppBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,16 @@ private bool FileCopyChecked(string src, string dst, string label)
}

Log.LogMessage(MessageImportance.Low, $"Copying file from '{src}' to '{dst}'");
File.Copy(src, dst, true);
_fileWrites.Add(dst);
try
{
File.Copy(src, dst, true);
_fileWrites.Add(dst);

return true;
return true;
}
catch (IOException ioex)
{
throw new LogAsErrorException($"{label} Failed to copy {src} to {dst} because {ioex.Message}");
}
}
}

0 comments on commit 7e433fb

Please sign in to comment.