| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- //
- // System.Web.Compilation.ParseException
- //
- // Authors:
- // Gonzalo Paniagua Javier ([email protected])
- //
- // (C) 2003 Ximian, Inc (http://www.ximian.com)
- //
- using System;
- using System.IO;
- namespace System.Web.Compilation
- {
- internal class ParseException : HtmlizedException
- {
- string fileName;
- string message;
- int line;
- int col;
- int sourceErrorLine;
- public ParseException (string fileName, string message, int line, int col)
- : base (message)
- {
- this.fileName = fileName;
- this.message = message;
- this.line = line;
- this.col = col;
- }
-
- public ParseException (string fileName, string message, int line, int col, Exception inner)
- : base (message, inner)
- {
- this.fileName = fileName;
- this.message = message;
- this.line = line;
- this.col = col;
- }
- public override string Title {
- get { return "Parser Error"; }
- }
- public override string Description {
- get {
- return "Error parsing a resource required to service this request. " +
- "Review your source file and modify it to fix this error.";
- }
- }
- public override string ErrorMessage {
- get { return message; }
- }
- public override string FileName {
- get { return fileName; }
- }
-
- public override StringReader SourceError {
- get {
- StreamReader input = new StreamReader (File.OpenRead (fileName));
- string result = GetErrorLines (input, line, out sourceErrorLine);
- input.Close ();
- input = null;
- return new StringReader (result);
- }
- }
- public override int SourceErrorLine {
- get { return sourceErrorLine; }
- }
- public override TextReader SourceFile {
- get { return null; }
- }
- }
- }
|