We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c19dae6 commit dfb2dceCopy full SHA for dfb2dce
include/xtensor-python/pycontainer.hpp
@@ -12,6 +12,7 @@
12
#include <cmath>
13
#include <functional>
14
#include <numeric>
15
+#include <sstream>
16
17
#include "pybind11/complex.h"
18
#include "pybind11/pybind11.h"
@@ -338,7 +339,10 @@ namespace xt
338
339
{
340
if(new_dim != N)
341
- throw std::runtime_error("Dims not matching.");
342
+ std::ostringstream err_msg;
343
+ err_msg << "Invalid conversion to pycontainer, expecting a container of dimension "
344
+ << N << ", got a container of dimension " << new_dim << ".";
345
+ throw std::runtime_error(err_msg.str());
346
}
347
return new_dim == N;
348
0 commit comments