1# Copyright 2014 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5"""Contains errors used by the fake_device_server.""" 6 7import cherrypy 8 9 10class HTTPError(cherrypy.HTTPError): 11 """Exception class to log the HTTPResponse before routing it to cherrypy.""" 12 def __init__(self, status, message): 13 """ 14 @param status: HTTPResponse status. 15 @param message: Message associated with the response. 16 """ 17 cherrypy.HTTPError.__init__(self, status, message) 18 cherrypy.log('ServerHTTPError status: %s message: %s' % (status, message)) 19