propagate c++ solver exceptions to python