mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 01:41:17 -10:00
* 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
80 lines
1.6 KiB
C#
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; }
|
|
}
|
|
}
|
|
}
|
|
|