Пример #1
0
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
Пример #2
0
def parse_event(event, projects):
    if _is_valid(event, projects):
        _process_event(event)
        logger.info('Parsed valid event: %s', event)
        return event
    return None