<s> '''<STR_LIT:U+0020>''' <EOL> from __future__ import absolute_import <EOL> import logging <EOL> log = logging . getLogger ( __name__ ) <EOL> import sys <EOL> from traceback import format_exception <EOL> from . . message import Message <EOL> from . import register <EOL> @ register <EOL> class error_1 ( Message ) : <EOL> '''<STR_LIT:U+0020>''' <EOL> msgtype = '<STR_LIT>' <EOL> revision = <NUM_LIT:1> <EOL> def __repr__ ( self ) : <EOL> msg = super ( error_1 , self ) . __repr__ ( ) <EOL> msg += "<STR_LIT>" <EOL> msg += self . content [ '<STR_LIT:text>' ] <EOL> if "<STR_LIT>" in self . content : <EOL> msg += "<STR_LIT:\n>" <EOL> msg += "<STR_LIT>" . join ( self . content [ '<STR_LIT>' ] ) <EOL> return msg <EOL> @ classmethod <EOL> def create ( cls , request_id , text , ** metadata ) : <EOL> '''<STR_LIT:U+0020>''' <EOL> header = cls . create_header ( request_id = request_id ) <EOL> content = { <EOL> '<STR_LIT:text>' : text , <EOL> } <EOL> ex_type , ex , tb = sys . exc_info ( ) <EOL> if ex_type : <EOL> content [ '<STR_LIT>' ] = format_exception ( ex_type , ex , tb ) <EOL> return cls ( header , metadata , content ) </s>
