PluginException should provide a getPluginId() method

Created on 26 October 2013, over 10 years ago
Updated 27 March 2023, about 1 year ago

Problem/Motivation

When catching plugin exceptions it might come in handy to figure out for which plugin ID the exception was thrown.
I didn't check whether all usages of PluginException are in fact in the scope of a plugin ID, but I'm feeling like they might.

Proposed resolution

1. A getPluginId() method already existed in InvalidPluginDefinitionException so I moved it to PluginException alongside the protected var $pluginId.
2. Add a pluginId parameter to PluginException constructor and re-factor every instantiation of this class and its subclasses.

Remaining tasks

1. Is provided by patch in #5
2. Add a pluginId parameter to PluginException constructor and re-factor every instantiation of this class and its subclasses.

API changes

InvalidPluginException class will now requires a plugin id parameter.

Original report by @tstoeckler →

📌 Task
Status

Needs work

Version

10.1 ✨

Component
Plugin  →

Last updated about 16 hours ago

Created by

🇩🇪Germany tstoeckler Essen, Germany

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

  • Needs beta evaluation

    Since the first beta of Drupal 8 was released, every new 8.0.x issue should have a beta evaluation in the summary, to help clarify whether the 8.0.0 release is a target for that issue.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024