# Path: httoop/util.py
# class _Translateable(object):
# 
# 	def __init__(self, message, *args, **kwargs):
# 		self.message = message
# 		self._args = args
# 		self._kwargs = kwargs
# 		super(_Translateable, self).__init__(message, args, kwargs)
# 
# 	def translate(self):
# 		return self.message % (self._kwargs or self._args)
# 
# 	def __unicode__(self):
# 		return self.translate()
# 
# 	def __bytes__(self):
# 		return Unicode(self).encode('unicode_escape')
# 
# 	__str__ = __unicode__ if PY3 else __bytes__


from httoop.util import _Translateable


class Invalid(_Translateable, ValueError):
	u"""base class for invalid values"""


class InvalidLine(Invalid):
	u"""error raised when first line is invalid"""


class InvalidHeader(Invalid):
	u"""error raised when header is invalid"""


class InvalidURI(Invalid):
	u"""error raised when URI is invalid"""


class InvalidDate(Invalid):
	u"""error raised when Date is invalid"""


class InvalidBody(Invalid):
	u"""error raised when Body is invalid"""


class EncodeError(_Translateable, ValueError):
	u"""error raised when encoding failed"""



# Path: httoop/util.py
# class _Translateable(object):
# 
# 	def __init__(self, message, *args, **kwargs):
# 		self.message = message
# 		self._args = args
# 		self._kwargs = kwargs
# 		super(_Translateable, self).__init__(message, args, kwargs)
# 
# 	def translate(self):
# 		return self.message % (self._kwargs or self._args)
# 
# 	def __unicode__(self):
# 		return self.translate()
# 
# 	def __bytes__(self):
# 		return Unicode(self).encode('unicode_escape')
# 
# 	__str__ = __unicode__ if PY3 else __bytes__


# Path: httoop/exceptions.py
from httoop.util import _Translateable



class Invalid(_Translateable, ValueError):
	u"""base class for invalid values"""


class InvalidLine(Invalid):
	u"""error raised when first line is invalid"""


class InvalidHeader(Invalid):
	u"""error raised when header is invalid"""


class InvalidURI(Invalid):
	u"""error raised when URI is invalid"""


class InvalidDate(Invalid):
	u"""error raised when Date is invalid"""


class InvalidBody(Invalid):
	u"""error raised when Body is invalid"""


class EncodeError(_Translateable, ValueError):
	u"""error raised when encoding failed"""



class DecodeError(_Translateable, ValueError):