django-webpack-loader/webpack_loader/exceptions.py
Phala Ramonyai 14af9a21c0 Generalise exceptions and fix regression (#125)
* Fix regression for file opening

* Standardize exceptions raised by django-webpack-loader.

Make WebpackError the main exception, and have the rest of the
exceptions inherit form it.

* Create base exception
2017-07-12 04:49:56 +05:30

36 lines
700 B
Python

__all__ = (
'WebpackError',
'WebpackLoaderBadStatsError',
'WebpackLoaderTimeoutError',
'WebpackBundleLookupError'
)
class BaseWebpackLoaderException(Exception):
"""
Base exception for django-webpack-loader.
"""
class WebpackError(BaseWebpackLoaderException):
"""
General webpack loader error.
"""
class WebpackLoaderBadStatsError(BaseWebpackLoaderException):
"""
The stats file does not contain valid data.
"""
class WebpackLoaderTimeoutError(BaseWebpackLoaderException):
"""
The bundle took too long to compile.
"""
class WebpackBundleLookupError(BaseWebpackLoaderException):
"""
The bundle name was invalid.
"""