Skip to content

Commit

Permalink
switch std::invalid_argument to pybind11::value_error
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarhiggott committed Jul 24, 2024
1 parent bf70853 commit dabb42d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pymatching/sparse_blossom/driver/user_graph.pybind.cc
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void pm_pybind::pybind_user_graph_methods(py::module &m, py::class_<pm::UserGrap
std::cout << std::endl;
std::cout << "mwpm.flooder.negative_weight_sum: " << mwpm.flooder.negative_weight_sum << std::endl;
if (mwpm.flooder.negative_weight_sum != 0) {
throw std::invalid_argument(
throw py::value_error(
"Decoding to matched detection events not supported for graphs containing edges with negative weights.");
}
pm::decode_detection_events_to_match_edges(mwpm, detection_events_vec);
Expand Down

0 comments on commit dabb42d

Please sign in to comment.