2 // System.Web.Compilation.CompilationException
5 // Gonzalo Paniagua Javier (gonzalo@ximian.com)
7 // (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
11 using System.Collections;
12 using System.CodeDom.Compiler;
16 namespace System.Web.Compilation
18 internal class CompilationException : HtmlizedException
21 CompilerErrorCollection errors;
26 public CompilationException (string filename, CompilerErrorCollection errors, string fileText)
28 this.filename = filename;
30 this.fileText = fileText;
33 public override string SourceFile {
35 if (errors == null || errors.Count == 0)
38 return errors [0].FileName;
42 public override string FileName {
43 get { return filename; }
46 public override string Title {
47 get { return "Compilation Error"; }
50 public override string Description {
52 return "Error compiling a resource required to service this request. " +
53 "Review your source file and modify it to fix this error.";
57 public override string ErrorMessage {
59 if (errmsg == null && errors != null) {
60 StringBuilder sb = new StringBuilder ();
61 foreach (CompilerError err in errors) {
65 errmsg = sb.ToString ();
72 public override string FileText {
73 get { return fileText; }
76 public override int [] ErrorLines {
78 if (errorLines == null && errors != null) {
79 ArrayList list = new ArrayList ();
80 foreach (CompilerError err in errors) {
84 errorLines = (int []) list.ToArray (typeof (int));
85 Array.Sort (errorLines);
92 public override bool ErrorLinesPaired {