How to Handle NZEC Errors in Python?