mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 01:41:17 -10:00
* list: added a couple of new files. * System.Web/HtmlizedException.cs: base class for exceptions that makes it easy to generate error pages. * System.Web/HttpException.cs: improved error displaying. * System.Web/HttpRuntime.cs: removed debugging output. * System.Web.Compilation/AspGenerator.cs: throw ParseException on parse error. * System.Web.Compilation/AspParser.cs: added Line and Column props. * System.Web.Compilation/CompilationException.cs: derives now from HtmlizedException. * System.Web.Compilation/CompilationResult.cs: added fileName field. Fixed set_ExitCode. * System.Web.Compilation/GlobalAsaxCompiler.cs: * System.Web.Compilation/PageCompiler.cs: * System.Web.Compilation/UserControlCompiler.cs: pass the file name in the CompilationResult. * System.Web.Compilation/ParseException.cs: new exception. svn path=/trunk/mcs/; revision=11467
79 lines
1.6 KiB
C#
79 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;
|
|
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; }
|
|
}
|
|
}
|
|
}
|
|
|