Skip to content

Commit e8a75fd

Browse files
committed
Improve error message when the SetDataFromArray does not match
1 parent 8ba1e2c commit e8a75fd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Base.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,11 @@ void BindingBase::SetDataFromArray(BaseData* data, const py::array& value)
245245
return copyScalar<double>(data, nfo, src);
246246
else if(srcinfo.format=="f")
247247
return copyScalar<float>(data, nfo, src);
248-
else
249-
throw std::runtime_error("SetAttrFromArray :: unsupported fileformat");
248+
else{
249+
std::stringstream tmp;
250+
tmp << "SetAttrFromArray :: unsupported fileformat '" << srcinfo.format << "'" ;
251+
throw std::runtime_error(tmp.str());
252+
}
250253
}
251254

252255
}

0 commit comments

Comments
 (0)