Error checking for fetching SQL versions.

This commit is contained in:
DariusIII
2016-05-24 22:38:06 +02:00
parent d82c60aaad
commit 280c385cb0
+8 -3
View File
@@ -77,8 +77,13 @@ class Update extends \app\extensions\console\Command
$versions = new Versions(['git' => ($this->git instanceof Git) ? $this->git : null]);
$currentDb = $versions->getSQLPatchFromDB();
$currentXML = $versions->getSQLPatchFromFile();
try {
$currentDb = $versions->getSQLPatchFromDB();
$currentXML = $versions->getSQLPatchFromFile();
} catch (\PDOException $e) {
$this->out('Error fetching patch versions!', 'error');
return 1;
}
$this->out("Db: $currentDb,\tFile: $currentXML");
if ($currentDb < $currentXML) {
$db = new DbUpdate(['backup' => false]);
@@ -119,7 +124,7 @@ class Update extends \app\extensions\console\Command
if ($fail) {
$this->out('Db updating failed!!', 'error');
return false;
return 1;
}
};
}