src/backend/catalog/src/release-flight/release.py [36:60]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            },
        )

        return {
            'status': 'SUCCESS'
        }
    except dynamodb.meta.client.exceptions.ConditionalCheckFailedException as e:
        # Due to no specificity from the DDB error, this could also mean the flight
        # doesn't exist, but we should've caught that earlier in the flow.
        # TODO: Fix that. Could either use TransactGetItems, or Get then Update.
        raise FlightFullyBookedException(f"Flight with ID: {flight_id} is fully booked.")
    except ClientError as e:
        raise FlightReservationException(e.response['Error']['Message'])


def lambda_handler(event, context):
    if 'outboundFlightId' not in event:
        raise ValueError('Invalid arguments')

    try:
        ret = reserve_seat_on_flight(event['outboundFlightId'])
    except FlightReservationException as e:
        raise FlightReservationException(e)

    return json.dumps(ret)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/backend/catalog/src/reserve-flight/reserve.py [34:58]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            },
        )

        return {
            'status': 'SUCCESS'
        }
    except dynamodb.meta.client.exceptions.ConditionalCheckFailedException as e:
        # Due to no specificity from the DDB error, this could also mean the flight
        # doesn't exist, but we should've caught that earlier in the flow.
        # TODO: Fix that. Could either use TransactGetItems, or Get then Update.
        raise FlightFullyBookedException(f"Flight with ID: {flight_id} is fully booked.")
    except ClientError as e:
        raise FlightReservationException(e.response['Error']['Message'])


def lambda_handler(event, context):
    if 'outboundFlightId' not in event:
        raise ValueError('Invalid arguments')

    try:
        ret = reserve_seat_on_flight(event['outboundFlightId'])
    except FlightReservationException as e:
        raise FlightReservationException(e)

    return json.dumps(ret)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



