aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/WixCorruptFileException.cs
blob: f77f0d8ae3504e10ab7364f1c93d84870b4060a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// 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.

namespace WixToolset.Data
{
    using System;

    /// <summary>
    /// Exception when file does not match the expected format.
    /// </summary>
    public class WixCorruptFileException : WixException
    {
        public WixCorruptFileException(string path, FileFormat format, Exception innerException = null)
            : base(ErrorMessages.CorruptFileFormat(path, format), innerException)
        {
            this.Path = path;
            this.FileFormat = format;
        }

        /// <summary>
        /// Gets the actual file format found in the file.
        /// </summary>
        public FileFormat FileFormat { get; }

        /// <summary>
        /// Gets the path to the file with unexpected format.
        /// </summary>
        public string Path { get; }
    }
}