aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/WixUnexpectedFileFormatException.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Data/WixUnexpectedFileFormatException.cs')
-rw-r--r--src/WixToolset.Data/WixUnexpectedFileFormatException.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/WixToolset.Data/WixUnexpectedFileFormatException.cs b/src/WixToolset.Data/WixUnexpectedFileFormatException.cs
new file mode 100644
index 00000000..4d1e39e9
--- /dev/null
+++ b/src/WixToolset.Data/WixUnexpectedFileFormatException.cs
@@ -0,0 +1,35 @@
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
3namespace WixToolset.Data
4{
5 using System;
6
7 /// <summary>
8 /// Exception when file does not match the expected format.
9 /// </summary>
10 public class WixUnexpectedFileFormatException : WixException
11 {
12 public WixUnexpectedFileFormatException(string path, FileFormat expectedFormat, FileFormat format, Exception innerException = null)
13 : base(WixDataErrors.UnexpectedFileFormat(path, expectedFormat.ToString().ToLowerInvariant(), format.ToString().ToLowerInvariant()), innerException)
14 {
15 this.Path = path;
16 this.ExpectedFileFormat = expectedFormat;
17 this.FileFormat = format;
18 }
19
20 /// <summary>
21 /// Gets the expected file format.
22 /// </summary>
23 public FileFormat ExpectedFileFormat { get; private set; }
24
25 /// <summary>
26 /// Gets the actual file format found in the file.
27 /// </summary>
28 public FileFormat FileFormat { get; private set; }
29
30 /// <summary>
31 /// Gets the path to the file with unexpected format.
32 /// </summary>
33 public string Path { get; set; }
34 }
35}