Permalink
Browse files

better error reporting when a fubumvc app fails to restart

  • Loading branch information...
1 parent 26231c6 commit e3613bcf5a58b82bebedc8227b8e9374a07f934a @jeremydmiller jeremydmiller committed Oct 28, 2012
Showing with 269 additions and 104 deletions.
  1. +1 −1 bottles.cmd
  2. +0 −9 fubuTemplates/default/src/FUBUPROJECTNAME/FUBUPROJECTNAME.csproj
  3. +2 −5 src/AspNetApplication/AspNetApplication.csproj
  4. +2 −3 src/AspNetApplication/packages.config
  5. +3 −3 src/AssemblyPackage/AssemblyPackage.csproj
  6. +3 −3 src/AssemblyPackage/packages.config
  7. +3 −6 src/FubuMVC.AspNetTesting/FubuMVC.AspNetTesting.csproj
  8. +3 −4 src/FubuMVC.AspNetTesting/packages.config
  9. +5 −1 src/FubuMVC.Core/FubuApplication.cs
  10. +106 −0 src/FubuMVC.Core/FubuApplicationDescriber.cs
  11. +5 −3 src/FubuMVC.Core/FubuMVC.Core.csproj
  12. +3 −0 src/FubuMVC.Core/Packaging/FubuMvcPackageFacility.cs
  13. +14 −0 src/FubuMVC.Core/Runtime/AboutEndpoint.cs
  14. +3 −3 src/FubuMVC.Core/packages.config
  15. +3 −3 src/FubuMVC.HelloWorld/FubuMVC.HelloWorld.csproj
  16. +3 −3 src/FubuMVC.HelloWorld/packages.config
  17. +4 −4 src/FubuMVC.IntegrationTesting/FubuMVC.IntegrationTesting.csproj
  18. +4 −4 src/FubuMVC.IntegrationTesting/packages.config
  19. +4 −4 src/FubuMVC.SelfHost.Testing/FubuMVC.SelfHost.Testing.csproj
  20. +4 −4 src/FubuMVC.SelfHost.Testing/packages.config
  21. +3 −3 src/FubuMVC.SelfHost/FubuMVC.SelfHost.csproj
  22. +3 −3 src/FubuMVC.SelfHost/packages.config
  23. +9 −4 src/FubuMVC.StructureMap/FubuMVC.StructureMap.csproj
  24. +1 −1 src/FubuMVC.StructureMap/Properties/AssemblyInfo.cs
  25. +3 −3 src/FubuMVC.StructureMap/packages.config
  26. +4 −4 src/FubuMVC.TestingHarness/FubuMVC.TestingHarness.csproj
  27. +4 −4 src/FubuMVC.TestingHarness/packages.config
  28. +39 −3 src/FubuMVC.Tests/FubuApplicationTester.cs
  29. +5 −5 src/FubuMVC.Tests/FubuMVC.Tests.csproj
  30. +5 −5 src/FubuMVC.Tests/packages.config
  31. +5 −2 src/TestPackage1/TestPackage1.csproj
  32. +3 −2 src/TestPackage1/packages.config
  33. +7 −1 src/TestPackage2/TestPackage2.csproj
  34. +3 −1 src/TestPackage2/packages.config
View
@@ -1 +1 @@
-src\packages\Bottles.0.9.1.380\tools\BottleRunner.exe %*
+src\packages\Bottles.0.9.5.383\tools\BottleRunner.exe %*
@@ -33,15 +33,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Bottles">
- <HintPath>..\..\..\..\src\packages\Bottles.0.9.1.163\lib\Bottles.dll</HintPath>
- </Reference>
- <Reference Include="FubuCore">
- <HintPath>..\..\..\..\src\packages\FubuCore.0.9.3.98\lib\FubuCore.dll</HintPath>
- </Reference>
- <Reference Include="FubuLocalization">
- <HintPath>..\..\..\..\src\packages\FubuLocalization.0.9.3.98\lib\FubuLocalization.dll</HintPath>
- </Reference>
<Reference Include="FubuMVC.Core">
<HintPath>..\..\..\..\src\packages\FubuMVC.References.0.9.1.651\lib\net40\FubuMVC.Core.dll</HintPath>
</Reference>
@@ -33,14 +33,11 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Bottles">
- <HintPath>..\packages\Bottles.0.9.1.380\lib\Bottles.dll</HintPath>
- </Reference>
<Reference Include="FubuCore">
- <HintPath>..\packages\FubuCore.0.9.9.194\lib\FubuCore.dll</HintPath>
+ <HintPath>..\packages\FubuCore.0.9.9.196\lib\FubuCore.dll</HintPath>
</Reference>
<Reference Include="HtmlTags">
- <HintPath>..\packages\HtmlTags.1.2.0.123\lib\4.0\HtmlTags.dll</HintPath>
+ <HintPath>..\packages\HtmlTags.1.2.0.122\lib\4.0\HtmlTags.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="StructureMap, Version=2.6.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Bottles" version="0.9.1.380" />
- <package id="FubuCore" version="0.9.9.194" />
- <package id="HtmlTags" version="1.2.0.123" />
+ <package id="FubuCore" version="0.9.9.196" />
+ <package id="HtmlTags" version="1.2.0.122" />
<package id="structuremap" version="2.6.3" />
</packages>
@@ -32,13 +32,13 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Bottles">
- <HintPath>..\packages\Bottles.0.9.1.380\lib\Bottles.dll</HintPath>
+ <HintPath>..\packages\Bottles.0.9.5.383\lib\Bottles.dll</HintPath>
</Reference>
<Reference Include="FubuCore">
- <HintPath>..\packages\FubuCore.0.9.9.194\lib\FubuCore.dll</HintPath>
+ <HintPath>..\packages\FubuCore.0.9.9.196\lib\FubuCore.dll</HintPath>
</Reference>
<Reference Include="HtmlTags">
- <HintPath>..\packages\HtmlTags.1.2.0.123\lib\4.0\HtmlTags.dll</HintPath>
+ <HintPath>..\packages\HtmlTags.1.2.0.122\lib\4.0\HtmlTags.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Bottles" version="0.9.1.380" />
- <package id="FubuCore" version="0.9.9.194" />
- <package id="HtmlTags" version="1.2.0.123" />
+ <package id="Bottles" version="0.9.5.383" />
+ <package id="FubuCore" version="0.9.9.196" />
+ <package id="HtmlTags" version="1.2.0.122" />
</packages>
@@ -31,17 +31,14 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Bottles">
- <HintPath>..\packages\Bottles.0.9.1.380\lib\Bottles.dll</HintPath>
- </Reference>
<Reference Include="FubuCore">
- <HintPath>..\packages\FubuCore.0.9.9.194\lib\FubuCore.dll</HintPath>
+ <HintPath>..\packages\FubuCore.0.9.9.196\lib\FubuCore.dll</HintPath>
</Reference>
<Reference Include="FubuTestingSupport">
- <HintPath>..\packages\FubuTestingSupport.0.9.9.194\lib\FubuTestingSupport.dll</HintPath>
+ <HintPath>..\packages\FubuTestingSupport.0.9.9.196\lib\FubuTestingSupport.dll</HintPath>
</Reference>
<Reference Include="HtmlTags">
- <HintPath>..\packages\HtmlTags.1.2.0.123\lib\4.0\HtmlTags.dll</HintPath>
+ <HintPath>..\packages\HtmlTags.1.2.0.122\lib\4.0\HtmlTags.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Bottles" version="0.9.1.380" />
- <package id="FubuCore" version="0.9.9.194" />
- <package id="FubuTestingSupport" version="0.9.9.194" />
- <package id="HtmlTags" version="1.2.0.123" />
+ <package id="FubuCore" version="0.9.9.196" />
+ <package id="FubuTestingSupport" version="0.9.9.196" />
+ <package id="HtmlTags" version="1.2.0.122" />
<package id="NUnit" version="2.5.10.11092" />
<package id="RhinoMocks" version="3.6.1" />
<package id="structuremap" version="2.6.3" />
@@ -156,7 +156,11 @@ public FubuRuntime Bootstrap()
});
});
- PackageRegistry.AssertNoFailures();
+ FubuMvcPackageFacility.Restarted = DateTime.Now;
+
+ PackageRegistry.AssertNoFailures(() => {
+ throw new FubuException(0, FubuApplicationDescriber.WriteDescription());
+ });
var routes = buildRoutes(factory, graph);
routes.Each(r => RouteTable.Routes.Add(r));
@@ -0,0 +1,106 @@
+using System;
+using System.Collections.Generic;
+using Bottles;
+using FubuCore;
+using FubuCore.Descriptions;
+using FubuCore.Util.TextWriting;
+using FubuMVC.Core.Packaging;
+using FubuMVC.Core.Resources.Conneg;
+using StringWriter = System.IO.StringWriter;
+
+namespace FubuMVC.Core
+{
+ public static class FubuApplicationDescriber
+ {
+ public static string WriteDescription()
+ {
+ var writer = new System.IO.StringWriter();
+
+ writeProperties(writer);
+
+ writeErrors(writer);
+
+ writeAssemblies(writer);
+
+ writeBottles(writer);
+
+ return writer.ToString();
+ }
+
+ private static void writeBottles(StringWriter writer)
+ {
+ writer.WriteLine("------------------------------------------------------------------------------------------------");
+ writer.WriteLine("Logs");
+ writer.WriteLine("------------------------------------------------------------------------------------------------");
+
+ PackageRegistry.Diagnostics.EachLog((o, log) =>
+ {
+ if (log.Success)
+ {
+ writer.WriteLine(o.ToString());
+ writer.WriteLine(log.FullTraceText());
+ writer.WriteLine("------------------------------------------------------------------------------------------------");
+ }
+ });
+
+ writer.WriteLine();
+ }
+
+ private static void writeErrors(StringWriter writer)
+ {
+ writer.WriteLine("------------------------------------------------------------------------------------------------");
+ writer.WriteLine("Errors");
+ writer.WriteLine("------------------------------------------------------------------------------------------------");
+
+ PackageRegistry.Diagnostics.EachLog((o, log) =>
+ {
+ if (!log.Success)
+ {
+ writer.WriteLine(o.ToString());
+ writer.WriteLine(log.FullTraceText());
+ writer.WriteLine("------------------------------------------------------------------------------------------------");
+ }
+ });
+
+ writer.WriteLine();
+
+ }
+
+
+
+ private static void writeAssemblies(StringWriter writer)
+ {
+ var report = new TextReport();
+ report.StartColumns(2);
+ report.AddDivider('-');
+ report.AddText("Assemblies");
+ report.AddDivider('-');
+
+ AppDomain.CurrentDomain.GetAssemblies().Each(assem => {
+ var assemblyName = assem.GetName();
+ report.AddColumnData(assemblyName.Name, assemblyName.Version.ToString());
+ });
+
+ report.AddDivider('-');
+ report.Write(writer);
+
+ writer.WriteLine();
+ }
+
+ private static void writeProperties(StringWriter writer)
+ {
+ var report = new TextReport();
+ report.StartColumns(2);
+
+ if (FubuMvcPackageFacility.Restarted.HasValue)
+ report.AddColumnData("Restarted", FubuMvcPackageFacility.Restarted.ToString());
+ report.AddColumnData("Application Path", FubuMvcPackageFacility.GetApplicationPath());
+
+ report.Write(writer);
+
+ writer.WriteLine();
+ }
+
+
+ }
+}
@@ -35,16 +35,16 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Bottles">
- <HintPath>..\packages\Bottles.0.9.1.380\lib\Bottles.dll</HintPath>
+ <HintPath>..\packages\Bottles.0.9.5.383\lib\Bottles.dll</HintPath>
</Reference>
<Reference Include="FubuCore">
- <HintPath>..\packages\FubuCore.0.9.9.194\lib\FubuCore.dll</HintPath>
+ <HintPath>..\packages\FubuCore.0.9.9.196\lib\FubuCore.dll</HintPath>
</Reference>
<Reference Include="FubuLocalization">
<HintPath>..\packages\FubuLocalization.0.9.5.87\lib\FubuLocalization.dll</HintPath>
</Reference>
<Reference Include="HtmlTags">
- <HintPath>..\packages\HtmlTags.1.2.0.123\lib\4.0\HtmlTags.dll</HintPath>
+ <HintPath>..\packages\HtmlTags.1.2.0.122\lib\4.0\HtmlTags.dll</HintPath>
</Reference>
<Reference Include="Ionic.Zip">
<HintPath>..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll</HintPath>
@@ -97,6 +97,7 @@
<Compile Include="Endpoints\EndpointInvocation.cs" />
<Compile Include="Endpoints\HttpResponse.cs" />
<Compile Include="Endpoints\WebRequestResponseExtensions.cs" />
+ <Compile Include="FubuApplicationDescriber.cs" />
<Compile Include="Http\AspNet\AspNetResponse.cs" />
<Compile Include="Http\Compression\DeflateHttpContentEncoding.cs" />
<Compile Include="Http\Compression\DoNotCompressAttribute.cs" />
@@ -130,6 +131,7 @@
<Compile Include="Registration\ServiceRemoved.cs" />
<Compile Include="Registration\SettingsCollection.cs" />
<Compile Include="Resources\Etags\IHeadersCache.cs" />
+ <Compile Include="Runtime\AboutEndpoint.cs" />
<Compile Include="Runtime\Files\ContentFolder.cs" />
<Compile Include="Runtime\Files\FubuApplicationFiles.cs" />
<Compile Include="Runtime\Files\FubuFile.cs" />
@@ -3,6 +3,7 @@
using System.IO;
using System.Web.Hosting;
using Bottles;
+using Bottles.PackageLoaders;
using Bottles.PackageLoaders.LinkedFolders;
using FubuCore;
using FubuMVC.Core.Packaging.VirtualPaths;
@@ -60,6 +61,8 @@ public static string GetExplodedPackagesDirectory()
return FileSystem.Combine(GetApplicationPath(), FubuContentFolder);
}
+ public static DateTime? Restarted { get; set; }
+
private static string determineApplicationPathFromAppDomain()
{
var basePath = AppDomain.CurrentDomain.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar);
@@ -0,0 +1,14 @@
+using FubuCore.Descriptions;
+
+namespace FubuMVC.Core.Runtime
+{
+ public class AboutEndpoint
+ {
+ public string get__about()
+ {
+ return FubuApplicationDescriber.WriteDescription();
+ }
+
+
+ }
+}
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Bottles" version="0.9.1.380" />
+ <package id="Bottles" version="0.9.5.383" />
<package id="DotNetZip" version="1.9.1.8" />
- <package id="FubuCore" version="0.9.9.194" />
+ <package id="FubuCore" version="0.9.9.196" />
<package id="FubuLocalization" version="0.9.5.87" />
- <package id="HtmlTags" version="1.2.0.123" />
+ <package id="HtmlTags" version="1.2.0.122" />
<package id="structuremap" version="2.6.3" />
</packages>
@@ -36,13 +36,13 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Bottles">
- <HintPath>..\packages\Bottles.0.9.1.380\lib\Bottles.dll</HintPath>
+ <HintPath>..\packages\Bottles.0.9.5.383\lib\Bottles.dll</HintPath>
</Reference>
<Reference Include="FubuCore">
- <HintPath>..\packages\FubuCore.0.9.9.194\lib\FubuCore.dll</HintPath>
+ <HintPath>..\packages\FubuCore.0.9.9.196\lib\FubuCore.dll</HintPath>
</Reference>
<Reference Include="HtmlTags">
- <HintPath>..\packages\HtmlTags.1.2.0.123\lib\4.0\HtmlTags.dll</HintPath>
+ <HintPath>..\packages\HtmlTags.1.2.0.122\lib\4.0\HtmlTags.dll</HintPath>
</Reference>
<Reference Include="RazorEngine, Version=3.0.8.0, Culture=neutral, PublicKeyToken=9ee697374c7e744a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Bottles" version="0.9.1.380" />
- <package id="FubuCore" version="0.9.9.194" />
- <package id="HtmlTags" version="1.2.0.123" />
+ <package id="Bottles" version="0.9.5.383" />
+ <package id="FubuCore" version="0.9.9.196" />
+ <package id="HtmlTags" version="1.2.0.122" />
<package id="RazorEngine" version="3.0.8" />
<package id="structuremap" version="2.6.3" />
</packages>
@@ -36,19 +36,19 @@
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Bottles">
- <HintPath>..\packages\Bottles.0.9.1.380\lib\Bottles.dll</HintPath>
+ <HintPath>..\packages\Bottles.0.9.5.383\lib\Bottles.dll</HintPath>
</Reference>
<Reference Include="Castle.Core">
<HintPath>..\packages\Castle.Core.3.0.0.4001\lib\net40-client\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="FubuCore">
- <HintPath>..\packages\FubuCore.0.9.9.194\lib\FubuCore.dll</HintPath>
+ <HintPath>..\packages\FubuCore.0.9.9.196\lib\FubuCore.dll</HintPath>
</Reference>
<Reference Include="FubuTestingSupport">
- <HintPath>..\packages\FubuTestingSupport.0.9.9.194\lib\FubuTestingSupport.dll</HintPath>
+ <HintPath>..\packages\FubuTestingSupport.0.9.9.196\lib\FubuTestingSupport.dll</HintPath>
</Reference>
<Reference Include="HtmlTags">
- <HintPath>..\packages\HtmlTags.1.2.0.123\lib\4.0\HtmlTags.dll</HintPath>
+ <HintPath>..\packages\HtmlTags.1.2.0.122\lib\4.0\HtmlTags.dll</HintPath>
</Reference>
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<HintPath>..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll</HintPath>
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Bottles" version="0.9.1.380" />
+ <package id="Bottles" version="0.9.5.383" />
<package id="Castle.Core" version="3.0.0.4001" />
<package id="DotNetZip" version="1.9.1.8" />
- <package id="FubuCore" version="0.9.9.194" />
- <package id="FubuTestingSupport" version="0.9.9.194" />
- <package id="HtmlTags" version="1.2.0.123" />
+ <package id="FubuCore" version="0.9.9.196" />
+ <package id="FubuTestingSupport" version="0.9.9.196" />
+ <package id="HtmlTags" version="1.2.0.122" />
<package id="NUnit" version="2.5.10.11092" />
<package id="RhinoMocks" version="3.6.1" />
<package id="structuremap" version="2.6.3" />
Oops, something went wrong.

0 comments on commit e3613bc

Please sign in to comment.