Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display config import errors instead of generic message #2732

Closed
jhedstrom opened this issue May 1, 2017 · 1 comment
Closed

Display config import errors instead of generic message #2732

jhedstrom opened this issue May 1, 2017 · 1 comment

Comments

@jhedstrom
Copy link
Member

In the config export command, if there are errors, it currently just throws a generic exception:

      if ($config_importer->getErrors()) {
        throw new \Drupal\Core\Config\ConfigException('Errors occurred during import');
      }

Rather, it would be nice to loop through those and display them as they contain meaningful information about what went wrong.

@jhedstrom
Copy link
Member Author

Latest 9 and 8 versions display this just fine. I'd misread the code. We show them below:

    catch (ConfigException $e) {
      // Return a negative result for UI purposes. We do not differentiate
      // between an actual synchronization error and a failed lock, because
      // concurrent synchronizations are an edge-case happening only when
      // multiple developers or site builders attempt to do it without
      // coordinating.
      $message = 'The import failed due for the following reasons:' . "\n";
      $message .= implode("\n", $config_importer->getErrors());

      watchdog_exception('config_import', $e);
      return drush_set_error('config_import_fail', $message);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant