def __write_error(self, status_code, error_message=None):
if error_message is None:<EOL><INDENT>error_message = httplib.responses[status_code]<EOL><DEDENT>status = '<STR_LIT>' % (status_code, httplib.responses[status_code])<EOL>message = EndpointsErrorMessage(<EOL>state=EndpointsErrorMessage.State.APPLICATION_ERROR,<EOL>error_message=error_message)<EOL>return status, self.__PROTOJSON.encode_message(message)<EOL>
Return the HTTP status line and body for a given error code and message.

        Args:
          status_code: HTTP status code to be returned.
          error_message: Error message to be returned.

        Returns:
          Tuple (http_status, body):
            http_status: HTTP status line, e.g. 200 OK.
            body: Body of the HTTP request.