what you are doing here is not catching both `TypeError` and `KeyError` you are actually creating a new variable called `KeyError` that will get the error thrown by `TypeError` assigned to it.

This is why the Jenkins build failed, I highly suggest you get a linter to check these files so you can catch them before sending a pull request.

The correct way to catch both exceptions is enclosing them as a tuple:

    except (TypeError, KeyError):