@tornado.gen.coroutine<EOL><INDENT>def getComponentException(self, tmaster, component_name, instances=[], callback=None):<DEDENT>
if not tmaster or not tmaster.host or not tmaster.stats_port:<EOL><INDENT>return<EOL><DEDENT>exception_request = tmaster_pb2.ExceptionLogRequest()<EOL>exception_request.component_name = component_name<EOL>if len(instances) > <NUM_LIT:0>:<EOL><INDENT>exception_request.instances.extend(instances)<EOL><DEDENT>request_str = exception_request.SerializeToString()<EOL>port = str(tmaster.stats_port)<EOL>host = tmaster.host<EOL>url = "<STR_LIT>".format(host, port)<EOL>request = tornado.httpclient.HTTPRequest(url,<EOL>body=request_str,<EOL>method='<STR_LIT:POST>',<EOL>request_timeout=<NUM_LIT:5>)<EOL>Log.debug('<STR_LIT>', url)<EOL>try:<EOL><INDENT>client = tornado.httpclient.AsyncHTTPClient()<EOL>result = yield client.fetch(request)<EOL>Log.debug("<STR_LIT>")<EOL><DEDENT>except tornado.httpclient.HTTPError as e:<EOL><INDENT>raise Exception(str(e))<EOL><DEDENT>responseCode = result.code<EOL>if responseCode >= <NUM_LIT>:<EOL><INDENT>message = "<STR_LIT>" + responseCode<EOL>Log.error(message)<EOL>raise tornado.gen.Return({<EOL>"<STR_LIT:message>": message<EOL>})<EOL><DEDENT>exception_response = tmaster_pb2.ExceptionLogResponse()<EOL>exception_response.ParseFromString(result.body)<EOL>if exception_response.status.status == common_pb2.NOTOK:<EOL><INDENT>if exception_response.status.HasField("<STR_LIT:message>"):<EOL><INDENT>raise tornado.gen.Return({<EOL>"<STR_LIT:message>": exception_response.status.message<EOL>})<EOL><DEDENT><DEDENT>ret = []<EOL>for exception_log in exception_response.exceptions:<EOL><INDENT>ret.append({'<STR_LIT>': exception_log.hostname,<EOL>'<STR_LIT>': exception_log.instance_id,<EOL>'<STR_LIT>': exception_log.stacktrace,<EOL>'<STR_LIT>': exception_log.lasttime,<EOL>'<STR_LIT>': exception_log.firsttime,<EOL>'<STR_LIT:count>': str(exception_log.count),<EOL>'<STR_LIT>': exception_log.logging})<EOL><DEDENT>raise tornado.gen.Return(ret)<EOL>
Get all (last 1000) exceptions for 'component_name' of the topology.
Returns an Array of exception logs on success.
Returns json with message on failure.