Exception raised when a plugin fails to load.
| 15 | |
| 16 | |
| 17 | class FailedToLoadPlugin(Flake8Exception): |
| 18 | """Exception raised when a plugin fails to load.""" |
| 19 | |
| 20 | FORMAT = 'Flake8 failed to load plugin "%(name)s" due to %(exc)s.' |
| 21 | |
| 22 | def __init__(self, plugin_name: str, exception: Exception) -> None: |
| 23 | """Initialize our FailedToLoadPlugin exception.""" |
| 24 | self.plugin_name = plugin_name |
| 25 | self.original_exception = exception |
| 26 | super().__init__(plugin_name, exception) |
| 27 | |
| 28 | def __str__(self) -> str: |
| 29 | """Format our exception message.""" |
| 30 | return self.FORMAT % { |
| 31 | "name": self.plugin_name, |
| 32 | "exc": self.original_exception, |
| 33 | } |
| 34 | |
| 35 | |
| 36 | class PluginRequestedUnknownParameters(Flake8Exception): |