summaryrefslogtreecommitdiff
path: root/src/flake8/exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/flake8/exceptions.py')
-rw-r--r--src/flake8/exceptions.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/flake8/exceptions.py b/src/flake8/exceptions.py
index e2dfd77..8e13cd8 100644
--- a/src/flake8/exceptions.py
+++ b/src/flake8/exceptions.py
@@ -54,17 +54,24 @@ class PluginRequestedUnknownParameters(Flake8Exception):
class PluginExecutionFailed(Flake8Exception):
"""The plugin failed during execution."""
- FORMAT = '"%(name)s" failed during execution due to "%(exc)s"'
-
- def __init__(self, plugin_name: str, exception: Exception) -> None:
+ FORMAT = '{fname}: "{plugin}" failed during execution due to {exc!r}'
+
+ def __init__(
+ self,
+ filename: str,
+ plugin_name: str,
+ exception: Exception,
+ ) -> None:
"""Utilize keyword arguments for message generation."""
+ self.filename = filename
self.plugin_name = plugin_name
self.original_exception = exception
- super().__init__(plugin_name, exception)
+ super().__init__(filename, plugin_name, exception)
def __str__(self) -> str:
"""Format our exception message."""
- return self.FORMAT % {
- "name": self.plugin_name,
- "exc": self.original_exception,
- }
+ return self.FORMAT.format(
+ fname=self.filename,
+ plugin=self.plugin_name,
+ exc=self.original_exception,
+ )