def write_error(self, status_code, **kwargs):
message = default_message = httplib.responses.get(status_code, '<STR_LIT>')<EOL>if '<STR_LIT>' in kwargs:<EOL><INDENT>(_, exc, _) = kwargs['<STR_LIT>']<EOL>if hasattr(exc, '<STR_LIT>'):<EOL><INDENT>message = str(exc.log_message) or default_message<EOL><DEDENT><DEDENT>self.logvalue('<STR_LIT>', message)<EOL>title = "<STR_LIT>".format(status_code, default_message)<EOL>body = "<STR_LIT>".format(status_code, message)<EOL>self.finish("<STR_LIT>" + title + "<STR_LIT>"<EOL>"<STR_LIT>" + body + "<STR_LIT>")<EOL>
Log halt_reason in service log and output error page