Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2022-04-07 12:45:54 +0300
committerJohn Molakvoæ <skjnldsv@protonmail.com>2022-04-07 12:49:20 +0300
commit0257315c3474a7e4e13af952c6191cedb6abcb99 (patch)
treec876617f6f1264d624294a52a1af0fa0c1d6e26f /lib
parent1e5a879d2e64f7c9afe51ed40a9c8eac6d581262 (diff)
Improve error logging on migration failure
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/DB/MigrationService.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php
index b228308cbfe..2b129edca26 100644
--- a/lib/private/DB/MigrationService.php
+++ b/lib/private/DB/MigrationService.php
@@ -27,7 +27,6 @@
*/
namespace OC\DB;
-use Doctrine\DBAL\Exception\DriverException;
use Doctrine\DBAL\Platforms\OraclePlatform;
use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Schema\Index;
@@ -424,10 +423,10 @@ class MigrationService {
foreach ($toBeExecuted as $version) {
try {
$this->executeStep($version, $schemaOnly);
- } catch (DriverException $e) {
+ } catch (\Exception $e) {
// The exception itself does not contain the name of the migration,
// so we wrap it here, to make debugging easier.
- throw new \Exception('Database error when running migration ' . $to . ' for app ' . $this->getApp(), 0, $e);
+ throw new \Exception('Database error when running migration ' . $version . ' for app ' . $this->getApp() . PHP_EOL. $e->getMessage(), 0, $e);
}
}
}
@@ -607,7 +606,6 @@ class MigrationService {
// we will NOT detect invalid length if the column is not modified
if (($sourceColumn === null || $sourceColumn->getLength() !== $thing->getLength() || $sourceColumn->getType()->getName() !== Types::STRING)
&& $thing->getLength() > 4000 && $thing->getType()->getName() === Types::STRING) {
- var_dump($sourceColumn === null, $sourceColumn->getLength(), $thing->getLength(), $sourceColumn->getName());
throw new \InvalidArgumentException('Column "' . $table->getName() . '"."' . $thing->getName() . '" is type String, but exceeding the 4.000 length limit.');
}
}