我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用BaseHTTPServer.HTTPServer.handle_error()。
def handle_error(self, request, client_address): if self.passthrough_errors: raise return HTTPServer.handle_error(self, request, client_address)
def handle_error(self, request, client_address): # surpress socket/ssl related errors cls, e = sys.exc_info()[:2] if cls is socket.error or cls is ssl.SSLError: pass else: return HTTPServer.handle_error(self, request, client_address)
def handle_error(self, request, client_address): if self.passthrough_errors: raise else: return HTTPServer.handle_error(self, request, client_address)
def handle_error(self, request, client_address): # surpress socket/ssl related errors cls, e = sys.exc_info()[:2] if cls is socket.error or cls is ssl.SSLError: pass else: return HTTPServer.handle_error(self, request, client_address) # noinspection PyAttributeOutsideInit,PyBroadException
def handle_error(self, request, client_address): """ Overwrite error handling to suppress socket/ssl related errors :param client_address: Address of client :param request: Request causing an error """ cls, e = sys.exc_info()[:2] if cls is socket.error or cls is ssl.SSLError: pass else: return HTTPServer.handle_error(self, request, client_address)