SimpleHTTPServer.SimpleHTTPRequestHandler.send_error

SimpleHTTPRequestHandler.send_error(code, message=None)

Send and log an error reply.

Arguments are the error code, and a detailed message. The detailed message defaults to the short entry matching the response code.

This sends an error response (so it must be called before any output has been generated), logs the error, and finally sends a piece of HTML explaining the error to the user.