mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-23 22:52:25 +01:00
exceptions: move LiveRequestException to wbexceptions cdx query: support for 'alt_url' which, if set, is used to create start_key and end_key
39 lines
976 B
Python
39 lines
976 B
Python
|
|
|
|
#=================================================================
|
|
class WbException(Exception):
|
|
def __init__(self, msg=None, url=None):
|
|
Exception.__init__(self, msg)
|
|
self.msg = msg
|
|
self.url = url
|
|
|
|
# Default Error Code
|
|
# def status(self):
|
|
# return '500 Internal Server Error'
|
|
|
|
|
|
#=================================================================
|
|
class AccessException(WbException):
|
|
def status(self):
|
|
return '403 Access Denied'
|
|
|
|
|
|
#=================================================================
|
|
class BadRequestException(WbException):
|
|
def status(self):
|
|
return '400 Bad Request'
|
|
|
|
|
|
#=================================================================
|
|
class NotFoundException(WbException):
|
|
def status(self):
|
|
return '404 Not Found'
|
|
|
|
|
|
#=================================================================
|
|
class LiveResourceException(WbException):
|
|
def status(self):
|
|
return '400 Bad Live Resource'
|
|
|
|
|