def parse_json_event(event): try: event = json.loads(event) except Exception as ex: logger.error("Failed json.loads on event: %s", event) logger.exception(ex) return None if _is_valid(event): _process_event(event) logger.info("Parsed valid event: %s", event) return event return None
def parse_event(event, projects): if _is_valid(event, projects): _process_event(event) logger.info('Parsed valid event: %s', event) return event return None