From 2f3ca296390d5b85f558f8c277d8266287f1aae8 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Sat, 7 Jan 2012 20:57:44 +0000 Subject: [PATCH] DBIsOutdatedException implemented --- Builder/IISMainHandler/build.txt | 2 +- FLocal.IISHandler/MainHandler.cs | 4 +--- Patcher.Web/DBIsOutdatedException.cs | 14 ++++++++++++++ Patcher.Web/Patcher.Web.csproj | 1 + Patcher.Web/PatcherInfo.cs | 6 ++++++ 5 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 Patcher.Web/DBIsOutdatedException.cs 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; }