Skip to content

Commit 5d2bca8

Browse files
committed
Added a helpful exception when stats file is not valid
1 parent 48e07fc commit 5d2bca8

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

MANIFEST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ setup.cfg
44
setup.py
55
webpack_loader/__init__.py
66
webpack_loader/apps.py
7+
webpack_loader/errors.py
78
webpack_loader/signals.py
89
webpack_loader/utils.py
910
webpack_loader/contrib/__init__.py

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from distutils.core import setup
22

3-
version = '0.2.0'
3+
version = '0.2.1'
44

55
setup(
66
name = 'django-webpack-loader',

webpack_loader/utils.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@
3131
entry['ignores'] = [re.compile(I) for I in entry['IGNORE']]
3232

3333

34-
class WebpackException(BaseException):
34+
class WebpackError(BaseException):
35+
pass
36+
37+
38+
class WebpackLoaderBadStatsError(BaseException):
3539
pass
3640

3741

@@ -79,4 +83,9 @@ def get_bundle(bundle_name, config):
7983
{error} in {file}
8084
{message}
8185
""".format(**assets)
82-
raise WebpackException(error)
86+
raise WebpackError(error)
87+
88+
raise WebpackLoaderBadStatsError(
89+
"The stats file does not contain valid data. Make sure "
90+
"webpack-bundle-tracker plugin is enabled and try to run "
91+
"webpack again.")

0 commit comments

Comments
 (0)