Catching runtime error in elm.py for cross-validation