Commit c4307c99 by Timothée Peignier

rationalize exceptions

parent 9a91c63e
......@@ -4,11 +4,11 @@ import os
import subprocess
from django.contrib.staticfiles import finders
from django.core.files.base import ContentFile
from django.utils.encoding import smart_str
from pipeline.conf import settings
from pipeline.exceptions import CompilerError
from pipeline.storage import default_storage
from pipeline.utils import to_class
......@@ -75,10 +75,6 @@ class CompilerBase(object):
return content
class CompilerError(Exception):
pass
class SubProcessCompiler(CompilerBase):
def execute_command(self, command, content=None, cwd=None):
pipe = subprocess.Popen(command, shell=True, cwd=cwd,
......
......@@ -13,6 +13,7 @@ from django.utils.encoding import smart_bytes, force_text
from pipeline.conf import settings
from pipeline.storage import default_storage
from pipeline.utils import to_class, relpath
from pipeline.exceptions import CompressorError
URL_DETECTOR = r'url\([\'"]?([^\s)]+\.[a-z]+[\?\#\d\w]*)[\'"]?\)'
URL_REPLACER = r'url\(__EMBED__(.+?)(\?\d+)?\)'
......@@ -224,11 +225,6 @@ class CompressorBase(object):
raise NotImplementedError
class CompressorError(Exception):
"""This exception is raised when a filter fails"""
pass
class SubProcessCompressor(CompressorBase):
def execute_command(self, command, content):
pipe = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
......
from __future__ import unicode_literals
class PipelineException(Exception):
pass
class PackageNotFound(PipelineException):
pass
class CompilerError(PipelineException):
pass
class CompressorError(PipelineException):
pass
......@@ -4,9 +4,10 @@ from django.contrib.staticfiles.finders import find
from django.core.files.base import ContentFile
from django.utils.encoding import smart_str
from pipeline.conf import settings
from pipeline.compilers import Compiler
from pipeline.compressors import Compressor
from pipeline.conf import settings
from pipeline.exceptions import PackageNotFound
from pipeline.glob import glob
from pipeline.signals import css_compressed, js_compressed
from pipeline.storage import default_storage
......@@ -121,7 +122,3 @@ class Packager(object):
for name in config:
packages[name] = Package(config[name])
return packages
class PackageNotFound(Exception):
pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment