From f8749f8e438b150884449ad3e2e13aed750de679 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Fri, 4 Nov 2022 01:05:28 -0700 Subject: Provide useful error message when file system operations fail Fixes 5417 --- .../wix/WixToolset.Extensibility/Services/IFileSystem.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/api') diff --git a/src/api/wix/WixToolset.Extensibility/Services/IFileSystem.cs b/src/api/wix/WixToolset.Extensibility/Services/IFileSystem.cs index cd987555..83a44400 100644 --- a/src/api/wix/WixToolset.Extensibility/Services/IFileSystem.cs +++ b/src/api/wix/WixToolset.Extensibility/Services/IFileSystem.cs @@ -4,6 +4,7 @@ namespace WixToolset.Extensibility.Services { using System; using System.IO; + using WixToolset.Data; /// /// Abstracts basic file system operations. @@ -13,34 +14,38 @@ namespace WixToolset.Extensibility.Services /// /// Copies a file. /// + /// Optional source line number requiring the copy. /// The file to copy. /// The destination file. /// Allow hardlinks. - void CopyFile(string source, string destination, bool allowHardlink); + void CopyFile(SourceLineNumber sourceLineNumbers, string source, string destination, bool allowHardlink); /// /// Deletes a file. /// + /// Optional source line number requiring the delete. /// The file to delete. /// Indicates the file must be deleted. Default is a best effort delete. /// Maximum retry attempts. Default is 4. - void DeleteFile(string source, bool throwOnError = false, int maxRetries = 4); + void DeleteFile(SourceLineNumber sourceLineNumbers, string source, bool throwOnError = false, int maxRetries = 4); /// /// Moves a file. /// + /// Optional source line number requiring the move. /// The file to move. /// The destination file. - void MoveFile(string source, string destination); + void MoveFile(SourceLineNumber sourceLineNumbers, string source, string destination); /// /// Opens a file. /// + /// Optional source line number requiring the file. /// The file to open. /// A System.IO.FileMode value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten. /// A System.IO.FileAccess value that specifies the operations that can be performed on the file. /// A System.IO.FileShare value specifying the type of access other threads have to the file. - FileStream OpenFile(string path, FileMode mode, FileAccess access, FileShare share); + FileStream OpenFile(SourceLineNumber sourceLineNumbers, string path, FileMode mode, FileAccess access, FileShare share); /// /// Executes an action and retries on any exception a few times with short pause -- cgit v1.2.3-55-g6feb