Add missing exception name

Hitting this exception currently returns:

    UnboundLocalError: local variable 'e' referenced before assignment