diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 0a5d03c..779ae3c 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -2039 \ No newline at end of file +2053 \ No newline at end of file diff --git a/FLocal.IISHandler/MainHandler.cs b/FLocal.IISHandler/MainHandler.cs index f66a931..ee6cb50 100644 --- a/FLocal.IISHandler/MainHandler.cs +++ b/FLocal.IISHandler/MainHandler.cs @@ -19,9 +19,7 @@ namespace FLocal.IISHandler { private void doProcessRequest(HttpContext httpcontext) { - if(PatcherInfo.instance.IsNeedsPatching) { - throw new FLocalException("DB is outdated"); - } + PatcherInfo.instance.CheckDBUpToDate(); Uri current = httpcontext.Request.Url; if(!current.Host.EndsWith(Config.instance.BaseHost)) { diff --git a/Patcher.Web/DBIsOutdatedException.cs b/Patcher.Web/DBIsOutdatedException.cs new file mode 100644 index 0000000..b03725d --- /dev/null +++ b/Patcher.Web/DBIsOutdatedException.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Patcher.Web { + class DBIsOutdatedException : ApplicationException { + + public DBIsOutdatedException() + : base("DB is outdated") { + } + + } +} diff --git a/Patcher.Web/Patcher.Web.csproj b/Patcher.Web/Patcher.Web.csproj index 6a28c65..252e57c 100644 --- a/Patcher.Web/Patcher.Web.csproj +++ b/Patcher.Web/Patcher.Web.csproj @@ -47,6 +47,7 @@ + diff --git a/Patcher.Web/PatcherInfo.cs b/Patcher.Web/PatcherInfo.cs index a142f6e..95496cb 100644 --- a/Patcher.Web/PatcherInfo.cs +++ b/Patcher.Web/PatcherInfo.cs @@ -23,6 +23,12 @@ namespace Patcher.Web { } } + public void CheckDBUpToDate() { + if(this.IsNeedsPatching) { + throw new DBIsOutdatedException(); + } + } + internal void PatchesInstalled() { this.AreNewPatchesInstalled = true; }