Skip to content

Commit eed0c9b

Browse files
authored
ENH: Forward error messages when creating Node geometries. (#885)
Signed-off-by: Michael Jackson <[email protected]>
1 parent daea37d commit eed0c9b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/simplnx/Filter/Actions/CreateGeometry1DAction.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class CreateGeometry1DAction : public IDataCreationAction
203203
Result result = CreateArray<MeshIndexType>(dataStructure, edgeTupleShape, {2}, edgesPath, mode, m_CreatedDataStoreFormat);
204204
if(result.invalid())
205205
{
206-
return MakeErrorResult(-5409, fmt::format("{}CreateGeometry1DAction: Could not allocate SharedEdgeList '{}'", prefix, edgesPath.toString()));
206+
return MergeResults(result, MakeErrorResult(-5409, fmt::format("{}CreateGeometry1DAction: Could not allocate SharedEdgeList '{}'", prefix, edgesPath.toString())));
207207
}
208208
SharedEdgeList* createdEdges = ArrayFromPath<MeshIndexType>(dataStructure, edgesPath);
209209
geometry1d->setEdgeList(*createdEdges);
@@ -214,7 +214,7 @@ class CreateGeometry1DAction : public IDataCreationAction
214214
result = CreateArray<float>(dataStructure, vertexTupleShape, {3}, vertexPath, mode, m_CreatedDataStoreFormat);
215215
if(result.invalid())
216216
{
217-
return MakeErrorResult(-5410, fmt::format("{}CreateGeometry1DAction: Could not allocate SharedVertList '{}'", prefix, vertexPath.toString()));
217+
return MergeResults(result, MakeErrorResult(-5410, fmt::format("{}CreateGeometry1DAction: Could not allocate SharedVertList '{}'", prefix, vertexPath.toString())));
218218
}
219219
Float32Array* vertexArray = ArrayFromPath<float>(dataStructure, vertexPath);
220220
geometry1d->setVertices(*vertexArray);

src/simplnx/Filter/Actions/CreateGeometry2DAction.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class CreateGeometry2DAction : public IDataCreationAction
203203
Result result = CreateArray<MeshIndexType>(dataStructure, faceTupleShape, {Geometry2DType::k_NumVerts}, trianglesPath, mode, m_CreatedDataStoreFormat);
204204
if(result.invalid())
205205
{
206-
return MakeErrorResult(-5509, fmt::format("{}CreateGeometry2DAction: Could not allocate SharedTriList '{}'", prefix, trianglesPath.toString()));
206+
return MergeResults(result, MakeErrorResult(-5509, fmt::format("{}CreateGeometry2DAction: Could not allocate SharedTriList '{}'", prefix, trianglesPath.toString())));
207207
}
208208
SharedTriList* triangles = ArrayFromPath<MeshIndexType>(dataStructure, trianglesPath);
209209
geometry2d->setFaceList(*triangles);
@@ -214,7 +214,7 @@ class CreateGeometry2DAction : public IDataCreationAction
214214
result = CreateArray<float>(dataStructure, vertexTupleShape, {3}, vertexPath, mode, m_CreatedDataStoreFormat);
215215
if(result.invalid())
216216
{
217-
return MakeErrorResult(-5510, fmt::format("{}CreateGeometry2DAction: Could not allocate SharedVertList '{}'", prefix, vertexPath.toString()));
217+
return MergeResults(result, MakeErrorResult(-5510, fmt::format("{}CreateGeometry2DAction: Could not allocate SharedVertList '{}'", prefix, vertexPath.toString())));
218218
}
219219
Float32Array* vertexArray = ArrayFromPath<float>(dataStructure, vertexPath);
220220
geometry2d->setVertices(*vertexArray);

src/simplnx/Filter/Actions/CreateGeometry3DAction.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class CreateGeometry3DAction : public IDataCreationAction
202202
Result result = CreateArray<MeshIndexType>(dataStructure, cellTupleShape, {Geometry3DType::k_NumVerts}, cellsPath, mode, m_CreatedDataStoreFormat);
203203
if(result.invalid())
204204
{
205-
return MakeErrorResult(-5609, fmt::format("{}CreateGeometry3DAction: Could not allocate SharedCellList '{}'", prefix, cellsPath.toString()));
205+
return MergeResults(result, MakeErrorResult(-5609, fmt::format("{}CreateGeometry3DAction: Could not allocate SharedCellList '{}'", prefix, cellsPath.toString())));
206206
}
207207
SharedCellList* polyhedronList = ArrayFromPath<MeshIndexType>(dataStructure, cellsPath);
208208
geometry3d->setPolyhedraList(*polyhedronList);
@@ -213,7 +213,7 @@ class CreateGeometry3DAction : public IDataCreationAction
213213
result = CreateArray<float>(dataStructure, vertexTupleShape, {3}, vertexPath, mode, m_CreatedDataStoreFormat);
214214
if(result.invalid())
215215
{
216-
return MakeErrorResult(-5610, fmt::format("{}CreateGeometry3DAction: Could not allocate SharedVertList '{}'", prefix, vertexPath.toString()));
216+
return MergeResults(result, MakeErrorResult(-5610, fmt::format("{}CreateGeometry3DAction: Could not allocate SharedVertList '{}'", prefix, vertexPath.toString())));
217217
}
218218
Float32Array* vertexArray = ArrayFromPath<float>(dataStructure, vertexPath);
219219
geometry3d->setVertices(*vertexArray);

0 commit comments

Comments
 (0)