summaryrefslogtreecommitdiff
path: root/classes/db.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-04-25 13:39:01 +0300
committerAndrew Dolgov <[email protected]>2017-04-25 13:39:01 +0300
commit3c111597768a13ae05463b044f6e4d6dc18d8be0 (patch)
treed1d79b95c22501bf1e996dee8d39ec3a0ce149cd /classes/db.php
parentedb56571f281c3377d5cabb2e5e49dcebd0e6036 (diff)
return result codes if DB connection or --debug-feed fails
Diffstat (limited to 'classes/db.php')
-rw-r--r--classes/db.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/classes/db.php b/classes/db.php
index c7d6da910..e8cb2deab 100644
--- a/classes/db.php
+++ b/classes/db.php
@@ -23,12 +23,16 @@ class Db implements IDb {
}
}
- if (!$this->adapter) die("Error initializing database adapter for " . DB_TYPE);
+ if (!$this->adapter) {
+ print("Error initializing database adapter for " . DB_TYPE);
+ exit(100);
+ }
$this->link = $this->adapter->connect(DB_HOST, DB_USER, DB_PASS, DB_NAME, defined('DB_PORT') ? DB_PORT : "");
if (!$this->link) {
- die("Error connecting through adapter: " . $this->adapter->last_error());
+ print("Error connecting through adapter: " . $this->adapter->last_error());
+ exit(101);
}
error_reporting($er);