def _deliver_errored_events(errstream, recs):
rlogger.info("<STR_LIT>", len(recs))<EOL>rlogger.info(<EOL>"<STR_LIT>", json.dumps(recs[<NUM_LIT:0>], indent=<NUM_LIT:4>))<EOL>kinesis_stream = errstream.get("<STR_LIT>")<EOL>randomkey = str(uuid.uuid4())<EOL>if kinesis_stream:<EOL><INDENT>send_to_kinesis_stream(<EOL>recs,<EOL>kinesis_stream,<EOL>partition_key=errstream.get("<STR_LIT>", randomkey))<EOL>rlogger.info("<STR_LIT>", errstream)<EOL><DEDENT>delivery_stream = errstream.get("<STR_LIT>")<EOL>if delivery_stream:<EOL><INDENT>send_to_delivery_stream(errevents, delivery_stream)<EOL>rlogger.info("<STR_LIT>",<EOL>delivery_stream)<EOL><DEDENT>
Deliver errors to error stream.