summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2008-11-08 01:19:03 +0000
committerTim Almdal <tnalmdal@shaw.ca>2008-11-08 01:19:03 +0000
commit57683d5b70be2460a767d1385253d787229214e2 (patch)
treec140676723e3527ca6527c98b834b1e755757879
parentdc90ad97396c258f3a5fe9b0c126af33f88a7b4a (diff)
Change how the modules table doesn't exist is caught. In running unit test, sometimes i would get the message "There was an SQL error: Table 'gallery3_unittest.modules' doesn't exist - ...." and sometimes I would get the message "Table modules does not exist in your database." In both cases the error code was 44.
-rw-r--r--core/helpers/core_installer.php2
-rw-r--r--modules/user/helpers/user_installer.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/helpers/core_installer.php b/core/helpers/core_installer.php
index bbcf9bd1..89d3f515 100644
--- a/core/helpers/core_installer.php
+++ b/core/helpers/core_installer.php
@@ -23,7 +23,7 @@ class core_installer {
try {
$base_version = ORM::factory("module")->where("name", "core")->find()->version;
} catch (Exception $e) {
- if ($e->getMessage() == "Table modules does not exist in your database.") {
+ if ($e->getCode() == 44) {
$base_version = 0;
} else {
throw $e;
diff --git a/modules/user/helpers/user_installer.php b/modules/user/helpers/user_installer.php
index 3e3af696..97202e1f 100644
--- a/modules/user/helpers/user_installer.php
+++ b/modules/user/helpers/user_installer.php
@@ -24,7 +24,7 @@ class user_installer {
try {
$base_version = ORM::factory("module")->where("name", "user")->find()->version;
} catch (Exception $e) {
- if ($e->getMessage() == "Table modules does not exist in your database.") {
+ if ($e->getCode() == 44) {
$base_version = 0;
} else {
Kohana::log("error", $e);