comparison mercurial/hgweb/common.py @ 6926:57b954d8d003

hgweb: raise ErrorResponses to communicate protocol errors
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Tue, 22 Jul 2008 18:23:20 +0200
parents e8332c8108ff
children b84d27386285
comparison
equal deleted inserted replaced
6925:87abfefafe02 6926:57b954d8d003
8 8
9 import errno, mimetypes, os 9 import errno, mimetypes, os
10 10
11 HTTP_OK = 200 11 HTTP_OK = 200
12 HTTP_BAD_REQUEST = 400 12 HTTP_BAD_REQUEST = 400
13 HTTP_UNAUTHORIZED = 401
13 HTTP_NOT_FOUND = 404 14 HTTP_NOT_FOUND = 404
15 HTTP_METHOD_NOT_ALLOWED = 405
14 HTTP_SERVER_ERROR = 500 16 HTTP_SERVER_ERROR = 500
15 17
16 class ErrorResponse(Exception): 18 class ErrorResponse(Exception):
17 def __init__(self, code, message=None): 19 def __init__(self, code, message=None):
18 Exception.__init__(self) 20 Exception.__init__(self)