# Path: partycrasher/pc_exceptions.py
# class PartyCrasherError(Exception):
#     """An error occured within PartyCrasher."""
#     http_code = 500
#     
#     def __init__(self, message=None, **kwargs):
#         self.__dict__.update(kwargs)
#         if message is None:
#             super(PartyCrasherError, self).__init__()
#         else:
#             super(PartyCrasherError, self).__init__(message)
#     
#     def get_extra(self):
#         extra = dict(self.__dict__)
#         #del extra['args']
#         extra['description'] = self.__class__.__doc__
#         return extra
# 
# Path: partycrasher/project.py
# class Project(object):
#     def __init__(self, project):
#     def __str__(self):
#     def __copy__(self):
#     def __hash__(self):
#     def __eq__(self, other):
#     def __repr__(self):
#     def jsonify(self):


from six import string_types, text_type
from flask import json, jsonify, request, redirect, make_response, url_for
from partycrasher.pc_encoder import pretty
from partycrasher.pc_exceptions import PartyCrasherError
from partycrasher.pc_type import maybe_date, maybe_int
from partycrasher.project import multi_project
from partycrasher.crash_type import multi_crash_type
import weakref
import re
import distutils
import sys
import traceback
import logging
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

"""
Utilties used in rest_service; these are kept here to unclutter the API file.
"""





logger = logging.getLogger(__name__)
ERROR = logger.error
WARN = logger.warn
INFO = logger.info
DEBUG = logger.debug

class BadRequest(PartyCrasherError):
    """
    Raised and handled when something funky happens.
    """
    http_code = 400
    
    def __init__(self, *args, **kwargs):
        super(BadRequest, self).__init__(*args)
        self.fields = kwargs

    def get_extra(self):
        return self.fields


# Path: partycrasher/pc_exceptions.py
# class PartyCrasherError(Exception):
#     """An error occured within PartyCrasher."""
#     http_code = 500
#     
#     def __init__(self, message=None, **kwargs):
#         self.__dict__.update(kwargs)
#         if message is None:
#             super(PartyCrasherError, self).__init__()
#         else:
#             super(PartyCrasherError, self).__init__(message)
#     
#     def get_extra(self):
#         extra = dict(self.__dict__)
#         #del extra['args']
#         extra['description'] = self.__class__.__doc__
#         return extra
# 
# Path: partycrasher/project.py
# class Project(object):
#     def __init__(self, project):
#     def __str__(self):
#     def __copy__(self):
#     def __hash__(self):
#     def __eq__(self, other):
#     def __repr__(self):
#     def jsonify(self):


# Path: partycrasher/rest/api_utils.py
from six import string_types, text_type
from flask import json, jsonify, request, redirect, make_response, url_for
from partycrasher.pc_encoder import pretty
from partycrasher.pc_exceptions import PartyCrasherError
from partycrasher.pc_type import maybe_date, maybe_int
from partycrasher.project import multi_project
from partycrasher.crash_type import multi_crash_type
import weakref
import re
import distutils
import sys
import traceback
import logging

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

"""
Utilties used in rest_service; these are kept here to unclutter the API file.
"""





logger = logging.getLogger(__name__)
ERROR = logger.error
WARN = logger.warn
INFO = logger.info
DEBUG = logger.debug

class BadRequest(PartyCrasherError):
    """
    Raised and handled when something funky happens.
    """
    http_code = 400
    
    def __init__(self, *args, **kwargs):
        super(BadRequest, self).__init__(*args)
        self.fields = kwargs

    def get_extra(self):
        return self.fields


class UnknownHostError(PartyCrasherError):