internal TemplatedMailCompileErrorFormatter(HttpCompileException e, int eventsRemaining, bool showDetails) : base(e)
 {
     this._eventsRemaining = eventsRemaining;
     this._showDetails = showDetails;
     base._hideDetailedCompilerOutput = true;
     base._dontShowVersion = true;
 }
Ejemplo n.º 2
0
 internal DynamicCompileErrorFormatter(HttpCompileException excep) {
     _excep = excep;
 }
Ejemplo n.º 3
0
 public static bool HandleHttpCompileException(HttpCompileException ex, bool clearError, HttpContext context, RouteData routeData, BaseController controller)
 {
     string rawUrl = context.Request.RawUrl;
     string url = context.Request.Url.ToString();
     if (Settings.AppLogSystemEventsToDb || Settings.AppLogSystemEventsToFile)
     {
         LogHttpCompileException(ex, context, routeData, controller);
     }
     if (Settings.AppUseFriendlyErrorPages)
     {
         ShowErrorPage(ErrorPage.Error_HttpError, ex.GetHttpCode(), ex, clearError, context, controller);
         return true;
     }
     return false;
 }
Ejemplo n.º 4
0
        private static void LogHttpCompileException(HttpCompileException ex, HttpContext context, RouteData routeData, BaseController controller)
        {
            int httpCode = ex.GetHttpCode();
            string message = string.Empty;

            message = "Http Compile Exception " + httpCode + " " + ex.GetHtmlErrorMessage()
                + "  \n-Message: " + ex.Message
                + "  \n-Source: " + ex.Source
                + "  \n-SourceCode: " + ex.SourceCode
                + "  \n-FileName: " + ex.Results.Errors.ToString()
                + "  \n-Compile Error Count: " + ex.Results.Errors.Count
                + "  \n-Compile Errors: " + ex.Results.Errors.ToString()
                + "  \n-WebEventCode: " + ex.WebEventCode
                + "  \n-ErrorCode: " + ex.ErrorCode
                + "  \n-TargetSiteName: " + ex.TargetSite.Name
                + "  \n-StackTrace: " + ex.StackTrace;

            LogException(message, ex, Models.SystemEventLevel.Error, context, routeData, controller);
        }
 internal DynamicCompileErrorFormatter(HttpCompileException excep)
 {
     this._excep = excep;
 }
 internal BuildResultCompileError(VirtualPath virtualPath, HttpCompileException compileException)
 {
     base.VirtualPath = virtualPath;
     this._compileException = compileException;
 }
Ejemplo n.º 7
0
		public void Constructor2b_Deny_Unrestricted ()
		{
			HttpCompileException e = new HttpCompileException ("message", new Exception ());
			Assert.IsNotNull (e.Message, "Message");
		}
Ejemplo n.º 8
0
		public void Constructor2a_Deny_Unrestricted ()
		{
			HttpCompileException e = new HttpCompileException (new CompilerResults (null), "source");
			Assert.IsNotNull (e.Message, "Message");
		}
Ejemplo n.º 9
0
		public void FixtureSetUp ()
		{
			hce = new HttpCompileException ();
		}
 private void CacheCompileErrors(AssemblyBuilder assemblyBuilder, CompilerResults results)
 {
     System.Web.Compilation.BuildProvider provider = null;
     foreach (CompilerError error in results.Errors)
     {
         if (!error.IsWarning)
         {
             System.Web.Compilation.BuildProvider buildProviderFromLinePragma = assemblyBuilder.GetBuildProviderFromLinePragma(error.FileName);
             if (((buildProviderFromLinePragma != null) && (buildProviderFromLinePragma is BaseTemplateBuildProvider)) && (buildProviderFromLinePragma != provider))
             {
                 provider = buildProviderFromLinePragma;
                 CompilerResults results2 = new CompilerResults(null);
                 foreach (string str in results.Output)
                 {
                     results2.Output.Add(str);
                 }
                 results2.PathToAssembly = results.PathToAssembly;
                 results2.NativeCompilerReturnValue = results.NativeCompilerReturnValue;
                 results2.Errors.Add(error);
                 HttpCompileException compileException = new HttpCompileException(results2, assemblyBuilder.GetGeneratedSourceFromBuildProvider(buildProviderFromLinePragma));
                 BuildResult result = new BuildResultCompileError(buildProviderFromLinePragma.VirtualPathObject, compileException);
                 buildProviderFromLinePragma.SetBuildResultDependencies(result);
                 BuildManager.CacheVPathBuildResult(buildProviderFromLinePragma.VirtualPathObject, result, this._utcStart);
             }
         }
     }
 }