We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1f70cf3 + dfb2dce commit 4ffcfb7Copy full SHA for 4ffcfb7
include/xtensor-python/pycontainer.hpp
@@ -13,6 +13,7 @@
13
#include <cmath>
14
#include <functional>
15
#include <numeric>
16
+#include <sstream>
17
18
#include "pybind11/complex.h"
19
#include "pybind11/pybind11.h"
@@ -356,7 +357,10 @@ namespace xt
356
357
{
358
if(new_dim != N)
359
- throw std::runtime_error("Dims not matching.");
360
+ std::ostringstream err_msg;
361
+ err_msg << "Invalid conversion to pycontainer, expecting a container of dimension "
362
+ << N << ", got a container of dimension " << new_dim << ".";
363
+ throw std::runtime_error(err_msg.str());
364
}
365
return new_dim == N;
366
0 commit comments