I'm fairly new to Python so bear with me please.
I have a function that takes two parameters, an api response and an output object, i need to assign some values from the api response to the output object:

```
def map_data(output, response):
    try:
        output['car']['name'] = response['name']
        output['car']['color'] = response['color']
        output['car']['date'] = response['date']
        #other mapping
        .
        . 
        .
        .
        #other mapping
     except KeyError as e:
        logging.error("Key Missing in api Response:  %s", str(e))
        pass

     return output

```

Now sometimes, the api response is missing some keys i'm using to generate my output object, so i used the KeyError exception to handle this case.

Now my question is, in a case where the 'color' key is missing from the api response, how can i catch the exception and continue to the line after it `output['car']['date'] = response['date']` and the rest of the instructions.

i tried the `pass` instruction but it didn't have any affect.

Ps: i know i can check the existence of the key using:

```
if response.get('color') is not None: 
 output['car']['color'] = response['color']      

```

and then assign the values but seeing that i have about 30 values i need to map, is there any other way i can implement ? Thank you