summaryrefslogtreecommitdiff
path: root/pygments/formatters
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2019-11-29 06:12:48 +0100
committerGeorg Brandl <georg@python.org>2019-11-29 06:12:48 +0100
commit689c25a627dcdc2e922cd0419f4c163fe90ccd42 (patch)
tree3891be25756eee118238bc6b9c8e916c2b58a56f /pygments/formatters
parent50793de1862a78f36617d9b966d437c72b27a95c (diff)
downloadpygments-git-689c25a627dcdc2e922cd0419f4c163fe90ccd42.tar.gz
use IOError reason in error message
Diffstat (limited to 'pygments/formatters')
-rw-r--r--pygments/formatters/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pygments/formatters/__init__.py b/pygments/formatters/__init__.py
index 4fa4178e..6f1130a8 100644
--- a/pygments/formatters/__init__.py
+++ b/pygments/formatters/__init__.py
@@ -108,8 +108,8 @@ def load_formatter_from_file(filename, formattername="CustomFormatter",
# And finally instantiate it with the options
return formatter_class(**options)
except IOError as err:
- raise ClassNotFound('cannot read %s' % filename)
- except ClassNotFound as err:
+ raise ClassNotFound('cannot read %s: %s' % (filename, err))
+ except ClassNotFound:
raise
except Exception as err:
raise ClassNotFound('error when loading custom formatter: %s' % err)