Problem/Motivation

\Drupal\migrate\MigrateExecutable constructor says that it might throw \Drupal\migrate\MigrateException, but it's not true anymore.

It was introduced back in 2013 in the first migration commit when exception could be thrown in case of invalid memory limit.
See: https://git.drupalcode.org/project/drupal/-/commit/67f30bc0a1f0007f4725a...

Looking at the current state, it's not the case anymore: https://git.drupalcode.org/project/drupal/-/blob/9.2.x/core/modules/migr...

Proposed resolution

Remove @throws \Drupal\migrate\MigrateException line from the constructor.

Issue fork drupal-3189054

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Matroskeen created an issue. See original summary.

matroskeen’s picture

Status: Active » Needs review
matroskeen’s picture

I checked all occurences of new MigrateExecutable in 9.2.x branch and didn't find any try-catch constructions.
I think it also proves the fact that this "throw" doc line is not necessary.

quietone’s picture

Status: Needs review » Reviewed & tested by the community

I reviewed the patch, all one line of it!

I checked the methods called in the constructor and I agree with Matroskeen there is nothing that will throw a MigrateException. Did some research and the throw was removed from MigrateExecutable in this commit and the docs was not updated.

Off we go!

  • catch committed 6503169 on 9.2.x
    Issue #3189054 by Matroskeen, quietone: Exception 'MigrateException' is...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 6503169 and pushed to 9.2.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.