'e' is not actually defined. Define it as 'exc' in the except block and update this 'e' to 'exc'