#20098: Extension build errors are now logged

Work Item: 20098
This commit is contained in:
Lombiq
2013-10-03 12:50:24 +02:00
committed by Zoltán Lehóczky
parent dfd6e0985e
commit 840975e6b4

View File

@@ -3,6 +3,9 @@ using System.Collections.Generic;
using System.Reflection;
using System.Web.Compilation;
using Orchard.FileSystems.VirtualPath;
using Orchard.Logging;
using System;
using Orchard.Exceptions;
namespace Orchard.Environment {
public interface IBuildManager : IDependency {
@@ -16,12 +19,16 @@ namespace Orchard.Environment {
private readonly IVirtualPathProvider _virtualPathProvider;
private readonly IAssemblyLoader _assemblyLoader;
public ILogger Logger { get; set; }
public DefaultBuildManager(
IVirtualPathProvider virtualPathProvider,
IAssemblyLoader assemblyLoader) {
_virtualPathProvider = virtualPathProvider;
_assemblyLoader = assemblyLoader;
Logger = NullLogger.Instance;
}
public IEnumerable<Assembly> GetReferencedAssemblies() {
@@ -43,9 +50,12 @@ namespace Orchard.Environment {
public Assembly GetCompiledAssembly(string virtualPath) {
try {
return BuildManager.GetCompiledAssembly(virtualPath);
return BuildManager.GetCompiledAssembly(virtualPath);
}
catch {
catch (Exception ex) {
if (ex.IsFatal()) throw;
Logger.Warning(ex, "Error when compiling assembly under {0}.", virtualPath);
return null;
}