Skip to content

Make reading the menu not fail when a new station is added. #1

@BenJetson

Description

@BenJetson

Currently, if an unrecognized station (not in VALUE_MATRIX) is found, an error occurs and Alexa says there was a problem.

Relevant log from CloudWatch:

'Theme Meal': KeyError
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 98, in lambda_handler
speech = on_intent(event["request"], event["session"])
File "/var/task/lambda_function.py", line 33, in on_intent
stations = parse_stations(page)
File "/var/task/dining.py", line 194, in parse_stations
stations.append(Station(name, items))
File "/var/task/dining.py", line 58, in __init__
self.value = Station.VALUE_MATRIX[name.strip()]
KeyError: 'Theme Meal'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions