Skip to content
Snippets Groups Projects
Unverified Commit c1f28f8d authored by Joas Schilling's avatar Joas Schilling
Browse files

Make debugging migration exceptions easier

parent e02c9ec1
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
namespace OC\DB; namespace OC\DB;
use Doctrine\DBAL\Exception\DriverException;
use Doctrine\DBAL\Platforms\OraclePlatform; use Doctrine\DBAL\Platforms\OraclePlatform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\Index;
...@@ -421,7 +422,13 @@ class MigrationService { ...@@ -421,7 +422,13 @@ class MigrationService {
// read known migrations // read known migrations
$toBeExecuted = $this->getMigrationsToExecute($to); $toBeExecuted = $this->getMigrationsToExecute($to);
foreach ($toBeExecuted as $version) { foreach ($toBeExecuted as $version) {
$this->executeStep($version, $schemaOnly); try {
$this->executeStep($version, $schemaOnly);
} catch (DriverException $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);
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment