Files
mono/mcs/class/System.Web/System.Web.Compilation/ParseException.cs
T
Gonzalo Paniagua Javier 0bd263fbfb 2003-03-24 Gonzalo Paniagua Javier <[email protected]>
* System.Web/HtmlizedException.cs:
	* System.Web/HttpException.cs:
	* System.Web.Compilation/CompilationException.cs:
	* System.Web.Compilation/ParseException.cs: display the correct line
	number in error messages.

	* System.Web.Compilation/AspElements.cs: added TargetSchema attribute
	for control. It's ignored.

svn path=/trunk/mcs/; revision=12782
2003-03-24 17:00:49 +00:00

80 lines
1.6 KiB
C#

//
// 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 >= 1 ? line : 1;
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 >= 1 ? line : 1;
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 - 1, out sourceErrorLine);
input.Close ();
input = null;
return new StringReader (result);
}
}
public override int SourceErrorLine {
get { return sourceErrorLine; }
}
public override TextReader SourceFile {
get { return null; }
}
}
}