diff --git a/AchmeErrorSite/400.aspx b/AchmeErrorSite/400.aspx new file mode 100644 index 0000000..747ba26 --- /dev/null +++ b/AchmeErrorSite/400.aspx @@ -0,0 +1,13 @@ +<%@ Page validateRequest="false" %> +<% Response.StatusCode = 400;%> + + + + + + 400 Server Error + + +

AST.NET 400 Server Error

+ + \ No newline at end of file diff --git a/AchmeErrorSite/404.aspx b/AchmeErrorSite/404.aspx new file mode 100644 index 0000000..cd9ba46 --- /dev/null +++ b/AchmeErrorSite/404.aspx @@ -0,0 +1,12 @@ +<% Response.StatusCode = 404; %> + + + + + + 404 Server Error + + +

AST.NET 404 Server Error

+ + \ No newline at end of file diff --git a/AchmeErrorSite/404.html b/AchmeErrorSite/404.html new file mode 100644 index 0000000..8c10aaa --- /dev/null +++ b/AchmeErrorSite/404.html @@ -0,0 +1,10 @@ + + + + Error + + + +

IIS 404 Error ocurred. Nice message here.

+ + diff --git a/AchmeErrorSite/500.aspx b/AchmeErrorSite/500.aspx new file mode 100644 index 0000000..de3dc87 --- /dev/null +++ b/AchmeErrorSite/500.aspx @@ -0,0 +1,13 @@ +<% Response.StatusCode = 500;%> + + + + + + + 500 Server Error + + +

AST.NET 500 Server Error

+ + \ No newline at end of file diff --git a/AchmeErrorSite/500.html b/AchmeErrorSite/500.html index 1d48bc1..aa5f669 100644 --- a/AchmeErrorSite/500.html +++ b/AchmeErrorSite/500.html @@ -5,6 +5,6 @@ -

Error ocurred. Nice message here.

+

IIS 500 Error ocurred. Nice message here.

diff --git a/AchmeErrorSite/AchmeErrorSite.csproj b/AchmeErrorSite/AchmeErrorSite.csproj index 1381252..8c66502 100644 --- a/AchmeErrorSite/AchmeErrorSite.csproj +++ b/AchmeErrorSite/AchmeErrorSite.csproj @@ -390,6 +390,10 @@ + + + + @@ -428,6 +432,7 @@ + Web.config @@ -465,7 +470,6 @@ - diff --git a/AchmeErrorSite/AchmeErrorSite.csproj.user b/AchmeErrorSite/AchmeErrorSite.csproj.user index 81033be..1df2f7b 100644 --- a/AchmeErrorSite/AchmeErrorSite.csproj.user +++ b/AchmeErrorSite/AchmeErrorSite.csproj.user @@ -2,7 +2,7 @@ true - ShowAllFiles + ProjectFiles diff --git a/AchmeErrorSite/App_Data/Models/all.dll.path b/AchmeErrorSite/App_Data/Models/all.dll.path index 526e774..3dcb6be 100644 --- a/AchmeErrorSite/App_Data/Models/all.dll.path +++ b/AchmeErrorSite/App_Data/Models/all.dll.path @@ -1 +1 @@ -C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\75441ed1\d5440aaf\App_Web_all.generated.cs.8f9494c4.9mgasjtp.dll \ No newline at end of file +C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\75441ed1\d5440aaf\App_Web_all.generated.cs.8f9494c4.ck2draoq.dll \ No newline at end of file diff --git a/AchmeErrorSite/App_Data/Models/all.generated.cs b/AchmeErrorSite/App_Data/Models/all.generated.cs index 758783d..592a52c 100644 --- a/AchmeErrorSite/App_Data/Models/all.generated.cs +++ b/AchmeErrorSite/App_Data/Models/all.generated.cs @@ -8,7 +8,7 @@ using Umbraco.ModelsBuilder; using Umbraco.ModelsBuilder.Umbraco; [assembly: PureLiveAssembly] -[assembly:ModelsBuilderAssembly(PureLive = true, SourceHash = "e5880c86ae4e4cee")] +[assembly:ModelsBuilderAssembly(PureLive = true, SourceHash = "903c58d4a6e8a2bf")] [assembly:System.Reflection.AssemblyVersion("0.0.0.1")] @@ -118,6 +118,32 @@ public static PublishedPropertyType GetModelPropertyType(Expressionnotfound + [PublishedContentModel("notfound")] + public partial class Notfound : PublishedContentModel + { +#pragma warning disable 0109 // new is redundant + public new const string ModelTypeAlias = "notfound"; + public new const PublishedItemType ModelItemType = PublishedItemType.Content; +#pragma warning restore 0109 + + public Notfound(IPublishedContent content) + : base(content) + { } + +#pragma warning disable 0109 // new is redundant + public new static PublishedContentType GetModelContentType() + { + return PublishedContentType.Get(ModelItemType, ModelTypeAlias); + } +#pragma warning restore 0109 + + public static PublishedPropertyType GetModelPropertyType(Expression> selector) + { + return PublishedContentModelUtility.GetModelPropertyType(GetModelContentType(), selector); + } + } + /// Folder [PublishedContentModel("Folder")] public partial class Folder : PublishedContentModel diff --git a/AchmeErrorSite/App_Data/Models/models.generated.cs b/AchmeErrorSite/App_Data/Models/models.generated.cs index c8b281c..4d66b1a 100644 --- a/AchmeErrorSite/App_Data/Models/models.generated.cs +++ b/AchmeErrorSite/App_Data/Models/models.generated.cs @@ -19,8 +19,8 @@ using Umbraco.ModelsBuilder.Umbraco; [assembly: PureLiveAssembly] -[assembly:ModelsBuilderAssembly(PureLive = true, SourceHash = "e5880c86ae4e4cee")] -[assembly:System.Reflection.AssemblyVersion("0.0.0.1")] +[assembly:ModelsBuilderAssembly(PureLive = true, SourceHash = "903c58d4a6e8a2bf")] +[assembly:System.Reflection.AssemblyVersion("0.0.0.2")] namespace Umbraco.Web.PublishedContentModels { @@ -102,6 +102,32 @@ public static PublishedPropertyType GetModelPropertyType(Expressionnotfound + [PublishedContentModel("notfound")] + public partial class Notfound : PublishedContentModel + { +#pragma warning disable 0109 // new is redundant + public new const string ModelTypeAlias = "notfound"; + public new const PublishedItemType ModelItemType = PublishedItemType.Content; +#pragma warning restore 0109 + + public Notfound(IPublishedContent content) + : base(content) + { } + +#pragma warning disable 0109 // new is redundant + public new static PublishedContentType GetModelContentType() + { + return PublishedContentType.Get(ModelItemType, ModelTypeAlias); + } +#pragma warning restore 0109 + + public static PublishedPropertyType GetModelPropertyType(Expression> selector) + { + return PublishedContentModelUtility.GetModelPropertyType(GetModelContentType(), selector); + } + } + /// Folder [PublishedContentModel("Folder")] public partial class Folder : PublishedContentModel diff --git a/AchmeErrorSite/App_Data/Models/models.hash b/AchmeErrorSite/App_Data/Models/models.hash index 700e76c..f8241b0 100644 --- a/AchmeErrorSite/App_Data/Models/models.hash +++ b/AchmeErrorSite/App_Data/Models/models.hash @@ -1 +1 @@ -e5880c86ae4e4cee \ No newline at end of file +903c58d4a6e8a2bf \ No newline at end of file diff --git a/AchmeErrorSite/App_Data/Umbraco.sdf b/AchmeErrorSite/App_Data/Umbraco.sdf index 5ea20a2..4a77410 100644 Binary files a/AchmeErrorSite/App_Data/Umbraco.sdf and b/AchmeErrorSite/App_Data/Umbraco.sdf differ diff --git a/AchmeErrorSite/Global.asax b/AchmeErrorSite/Global.asax index fdb49b7..53d2d54 100644 --- a/AchmeErrorSite/Global.asax +++ b/AchmeErrorSite/Global.asax @@ -1,2 +1,2 @@ -<%@ Application Inherits="AchmeErrorSite.SiteApplication" Language="C#" %> +<%@ Application Inherits="Umbraco.Web.UmbracoApplication" Language="C#" %> \ No newline at end of file diff --git a/AchmeErrorSite/SiteApplication.cs b/AchmeErrorSite/SiteApplication.cs deleted file mode 100644 index 74d88a5..0000000 --- a/AchmeErrorSite/SiteApplication.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Web; -using Umbraco.Web; - -namespace AchmeErrorSite -{ - public class SiteApplication : UmbracoApplication - { - protected new void Application_Error(object sender, EventArgs e) - { - // This method is triggered twice when an exception occurs. - // Only do anything if there is actually an error. - // Otherwise just ignore it. - - Exception lastError = Server.GetLastError(); - - if (lastError != null) - { - base.Application_Error(sender, e); - } - - if (Context.IsCustomErrorEnabled) - { - if (lastError != null) - { - var httpException = lastError as HttpException ?? new HttpException(500, "Internal error"); - - var code = httpException.GetHttpCode(); - Response.StatusCode = code; - Server.ClearError(); - Server.Transfer("/500.html"); - } - } - } - } -} \ No newline at end of file diff --git a/AchmeErrorSite/Views/Home.cshtml b/AchmeErrorSite/Views/Home.cshtml index bdfea86..652e396 100644 --- a/AchmeErrorSite/Views/Home.cshtml +++ b/AchmeErrorSite/Views/Home.cshtml @@ -2,7 +2,10 @@ Layout = null; }

Hello

-

Trigger razor error

-

Trigger compiled error

-

Trigger Umbraco 404

-

Trigger Media 404

\ No newline at end of file +

Umbraco login: admin@example.com / 12345678

+

Trigger razor error (Should respond with 500 status)

+

Trigger compiled error (Should respond with 500 status)

+

Trigger Request Validation error (Should respond with 400 status)

+

To trigger an IIS 500, rename Umbraco.Core.dll to Umbraco.Core.dll.bak (Should respond with 500 status)

+

Trigger Umbraco 404 (Should respond with 404 status)

+

Trigger Media 404 (Should respond with 404 status)

diff --git a/AchmeErrorSite/Views/RazorError.cshtml b/AchmeErrorSite/Views/RazorError.cshtml index 479b043..bc8fd5c 100644 --- a/AchmeErrorSite/Views/RazorError.cshtml +++ b/AchmeErrorSite/Views/RazorError.cshtml @@ -1,8 +1,10 @@ @{ - Layout = null; + Layout = null; string foo = null; foo.Split(','); + + //throw new HttpException(500,"arrrgh"); }

Razor error

\ No newline at end of file diff --git a/AchmeErrorSite/Views/notfound.cshtml b/AchmeErrorSite/Views/notfound.cshtml new file mode 100644 index 0000000..db5b672 --- /dev/null +++ b/AchmeErrorSite/Views/notfound.cshtml @@ -0,0 +1,5 @@ +@{ + Layout = null; +} + +

Umbraco custom 404

\ No newline at end of file diff --git a/AchmeErrorSite/Web.config b/AchmeErrorSite/Web.config index 089c831..63aedce 100644 --- a/AchmeErrorSite/Web.config +++ b/AchmeErrorSite/Web.config @@ -87,7 +87,11 @@ - + + + + +