Skip to content

Commit a61255c

Browse files
committed
Derive exceptions from Exception.
Per https://docs.python.org/3/library/exceptions.html: > programmers are encouraged to derive new exceptions from the Exception > class or one of its subclasses, and not from BaseException. Specifically deriving from BaseException prevents Jinja2 from handling errors and Django from displaying the debug page when the webpack build fails, because Jinja2 catches Exception (this is the logical behavior): https://github.com/mitsuhiko/jinja2/blob/5b498453b5898257b2287f14ef6c363799f1405a/jinja2/environment.py#L1009
1 parent b91c62b commit a61255c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

webpack_loader/utils.py

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

3333

34-
class WebpackError(BaseException):
34+
class WebpackError(Exception):
3535
pass
3636

3737

38-
class WebpackLoaderBadStatsError(BaseException):
38+
class WebpackLoaderBadStatsError(Exception):
3939
pass
4040

4141

0 commit comments

Comments
 (0)