Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294462

Write UnitTest for MigrationConfigurationTrait and fix Exception Handling

$
0
0

Problem/Motivation

MigrationConfigurationTrait is not covered by unit tests.

While writing the unit test here, it was also discovered that it catches a PDOException in a situation where it should be catching a DatabaseWrapperException.

To elaborate, there are two try/catch blocks in MigrationConfigurationTrait::getLegacyDrupalVersion. The second block, which was updated somewhat recently appears to catch the correct exception type. According to documentation (and poring over the code), Connection::query can throw DatabaseWrapperException, not a \PDOException.

Therefore, the first try/catch block should be updated to match the second one.

Proposed resolution

It is proposed that we should correct the exception handling as part of writing the unit test.

Remaining tasks

Review

User interface changes

none

API changes

none

Data model changes

none

Release notes snippet

none


Viewing all articles
Browse latest Browse all 294462

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>