Update constraint_lib.py

couple error catches