forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTemplateCompilationException.cs
More file actions
33 lines (31 loc) · 1.13 KB
/
Copy pathTemplateCompilationException.cs
File metadata and controls
33 lines (31 loc) · 1.13 KB
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
using System;
using System.CodeDom.Compiler;
using System.Collections.ObjectModel;
using System.Linq;
namespace ServiceStack.RazorEngine.Templating
{
/// <summary>
/// Defines an exception that occurs during compilation of a template.
/// </summary>
public class TemplateCompilationException : Exception
{
#region Constructors
/// <summary>
/// Initialises a new instance of <see cref="TemplateCompilationException"/>
/// </summary>
/// <param name="errors">The collection of compilation errors.</param>
public TemplateCompilationException(CompilerErrorCollection errors)
: base("Unable to compile template. Check the Errors list for details.")
{
var list = errors.Cast<CompilerError>().ToList();
Errors = new ReadOnlyCollection<CompilerError>(list);
}
#endregion
#region Properties
/// <summary>
/// Gets the collection of compiler errors.
/// </summary>
public ReadOnlyCollection<CompilerError> Errors { get; private set; }
#endregion
}
}