2 // System.Web.Compilation.ParseException
5 // Gonzalo Paniagua Javier (gonzalo@ximian.com)
7 // (C) 2003 Ximian, Inc (http://www.ximian.com)
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 namespace System.Web.Compilation
36 internal class ParseException : HtmlizedException
41 public ParseException (ILocation location, string message)
42 : this (location, message, null)
44 location = new Location (location);
48 public ParseException (ILocation location, string message, Exception inner)
49 : base (message, inner)
51 this.location = location;
54 public override string Title {
55 get { return "Parser Error"; }
58 public override string Description {
60 return "Error parsing a resource required to service this request. " +
61 "Review your source file and modify it to fix this error.";
65 public override string ErrorMessage {
66 get { return Message; }
69 public override string SourceFile {
70 get { return FileName; }
73 public override string FileName {
78 return location.Filename;
82 public override string FileText {
91 TextReader reader = new StreamReader (FileName);
92 fileText = reader.ReadToEnd ();
97 public override int [] ErrorLines {
102 return new int [] {location.BeginLine, location.EndLine};
106 public override bool ErrorLinesPaired {