summaryrefslogtreecommitdiff
path: root/coverage/html.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-08-16 13:05:50 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-08-16 13:05:50 -0400
commita9e68af8e85500debac8436336e54da694e745f5 (patch)
tree80945349828a496b900b8085822331de2e0aa7bf /coverage/html.py
parentf09dcf8e4b5ea0d31f3a149f787179982be5a93c (diff)
downloadpython-coveragepy-a9e68af8e85500debac8436336e54da694e745f5.tar.gz
More informative error message if can't find static files
Diffstat (limited to 'coverage/html.py')
-rw-r--r--coverage/html.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/coverage/html.py b/coverage/html.py
index 6d1bb43..c0dfe80 100644
--- a/coverage/html.py
+++ b/coverage/html.py
@@ -39,15 +39,22 @@ def data_filename(fname, pkgdir=""):
is provided, at that sub-directory.
"""
+ tried = []
for static_dir in STATIC_PATH:
static_filename = os.path.join(static_dir, fname)
if os.path.exists(static_filename):
return static_filename
+ else:
+ tried.append(static_filename)
if pkgdir:
static_filename = os.path.join(static_dir, pkgdir, fname)
if os.path.exists(static_filename):
return static_filename
- raise CoverageException("Couldn't find static file %r" % fname)
+ else:
+ tried.append(static_filename)
+ raise CoverageException(
+ "Couldn't find static file %r from %r, tried: %r" % (fname, os.getcwd(), tried)
+ )
def data(fname):