Files
mono/mcs/class/System.Web/System.Web.Compilation/CompilationException.cs
T
Gonzalo Paniagua Javier 216bec00c9 2003-02-11 Gonzalo Paniagua Javier <[email protected]>
* 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
2003-02-11 05:04:30 +00:00

76 lines
1.6 KiB
C#

//
// System.Web.Compilation.CompilationException
//
// Authors:
// Gonzalo Paniagua Javier ([email protected])
//
// (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
//
using System;
using System.Web;
using System.IO;
namespace System.Web.Compilation
{
internal class CompilationException : HtmlizedException
{
CompilationResult result;
public CompilationException (CompilationResult result)
: base ("Compilation Error")
{
this.result = result;
}
public CompilationException (string msg, CompilationResult result)
: base (msg)
{
this.result = result;
}
public CompilationException (CompilationCacheItem item)
{
this.result = item.Result;
}
public override string FileName {
get { return result.FileName; }
}
public override string Title {
get { return "Compilation Error"; }
}
public override string Description {
get {
return "Error compiling a resource required to service this request. " +
"Review your source file and modify it to fix this error.";
}
}
public override string ErrorMessage {
get {
//FIXME: it should be a one line message.
return result.CompilerOutput;
}
}
//TODO: get lines from compiler output.
public override StringReader SourceError { get {return null;}}
public override int SourceErrorLine { get { return 0; } }
public override TextReader SourceFile {
get {
StreamReader input = new StreamReader (File.OpenRead (FileName));
int sourceErrorLine;
string result = GetErrorLines (input, 0, out sourceErrorLine);
input.Close ();
input = null;
return new StringReader (result);
}
}
}
}