aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Protobuf/CompilerException.cs
blob: 8e50e405eb222ba9c50c99bc6e2226ea041f6f7e (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
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.Protobuf
{
    /// <summary>
    /// Represents an <see cref="IProtoCompiler"/> compilation exception.
    /// </summary>
    /// <seealso cref="System.Exception" />
    public class CompilerException : Exception
    {
        /// <summary>
        /// Gets the collection of compilation errors.
        /// </summary>
        public List<String> Issues { get; internal set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="CompilerException"/> class.
        /// </summary>
        public CompilerException()
        {
            Issues = new List<string>();
        }

        public override string Message => this.ToString();

        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String" /> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            return String.Join(Environment.NewLine, Issues);
        }
    }
}