| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- //
- // 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);
- }
- }
- }
- }
|