main
cs 48 lines 2.25 KB
Raw
1 // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3 namespace WixToolset.Core
4 {
5 using WixToolset.Data;
6
7 internal static class CoreErrors
8 {
9 public static Message UnableToCopyFile(SourceLineNumber sourceLineNumbers, string source, string destination, string detail)
10 {
11 return Message(sourceLineNumbers, Ids.UnableToCopyFile, "Unable to copy file from: {0}, to: {1}. Error detail: {2}", source, destination, detail);
12 }
13
14 public static Message UnableToDeleteFile(SourceLineNumber sourceLineNumbers, string path, string detail)
15 {
16 return Message(sourceLineNumbers, Ids.UnableToDeleteFile, "Unable to delete file: {0}. Error detail: {1}", path, detail);
17 }
18
19 public static Message UnableToMoveFile(SourceLineNumber sourceLineNumbers, string source, string destination, string detail)
20 {
21 return Message(sourceLineNumbers, Ids.UnableToMoveFile, "Unable to move file from: {0}, to: {1}. Error detail: {2}", source, destination, detail);
22 }
23
24 public static Message UnableToOpenFile(SourceLineNumber sourceLineNumbers, string path, string detail)
25 {
26 return Message(sourceLineNumbers, Ids.UnableToOpenFile, "Unable to open file: {0}. Error detail: {1}", path, detail);
27 }
28
29 public static Message BackendNotFound(string outputType, string outputPath)
30 {
31 return Message(null, Ids.BackendNotFound, "Unable to find a backend to process output type: {0} for output file: {1}. Specify a different output type or output file extension.", outputType, outputPath);
32 }
33
34 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
35 {
36 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args);
37 }
38
39 public enum Ids
40 {
41 UnableToCopyFile = 7010,
42 UnableToDeleteFile = 7011,
43 UnableToMoveFile = 7012,
44 UnableToOpenFile = 7013,
45 BackendNotFound = 7014,
46 } // last available is 7099. 7100 is WindowsInstallerBackendWarnings.
47 }
48 }