Skip to content

Commit

Permalink
ENH: Forward error messages when creating Node geometries. (#885)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson authored Mar 13, 2024
1 parent daea37d commit eed0c9b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/simplnx/Filter/Actions/CreateGeometry1DAction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class CreateGeometry1DAction : public IDataCreationAction
Result result = CreateArray<MeshIndexType>(dataStructure, edgeTupleShape, {2}, edgesPath, mode, m_CreatedDataStoreFormat);
if(result.invalid())
{
return MakeErrorResult(-5409, fmt::format("{}CreateGeometry1DAction: Could not allocate SharedEdgeList '{}'", prefix, edgesPath.toString()));
return MergeResults(result, MakeErrorResult(-5409, fmt::format("{}CreateGeometry1DAction: Could not allocate SharedEdgeList '{}'", prefix, edgesPath.toString())));
}
SharedEdgeList* createdEdges = ArrayFromPath<MeshIndexType>(dataStructure, edgesPath);
geometry1d->setEdgeList(*createdEdges);
Expand All @@ -214,7 +214,7 @@ class CreateGeometry1DAction : public IDataCreationAction
result = CreateArray<float>(dataStructure, vertexTupleShape, {3}, vertexPath, mode, m_CreatedDataStoreFormat);
if(result.invalid())
{
return MakeErrorResult(-5410, fmt::format("{}CreateGeometry1DAction: Could not allocate SharedVertList '{}'", prefix, vertexPath.toString()));
return MergeResults(result, MakeErrorResult(-5410, fmt::format("{}CreateGeometry1DAction: Could not allocate SharedVertList '{}'", prefix, vertexPath.toString())));
}
Float32Array* vertexArray = ArrayFromPath<float>(dataStructure, vertexPath);
geometry1d->setVertices(*vertexArray);
Expand Down
4 changes: 2 additions & 2 deletions src/simplnx/Filter/Actions/CreateGeometry2DAction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class CreateGeometry2DAction : public IDataCreationAction
Result result = CreateArray<MeshIndexType>(dataStructure, faceTupleShape, {Geometry2DType::k_NumVerts}, trianglesPath, mode, m_CreatedDataStoreFormat);
if(result.invalid())
{
return MakeErrorResult(-5509, fmt::format("{}CreateGeometry2DAction: Could not allocate SharedTriList '{}'", prefix, trianglesPath.toString()));
return MergeResults(result, MakeErrorResult(-5509, fmt::format("{}CreateGeometry2DAction: Could not allocate SharedTriList '{}'", prefix, trianglesPath.toString())));
}
SharedTriList* triangles = ArrayFromPath<MeshIndexType>(dataStructure, trianglesPath);
geometry2d->setFaceList(*triangles);
Expand All @@ -214,7 +214,7 @@ class CreateGeometry2DAction : public IDataCreationAction
result = CreateArray<float>(dataStructure, vertexTupleShape, {3}, vertexPath, mode, m_CreatedDataStoreFormat);
if(result.invalid())
{
return MakeErrorResult(-5510, fmt::format("{}CreateGeometry2DAction: Could not allocate SharedVertList '{}'", prefix, vertexPath.toString()));
return MergeResults(result, MakeErrorResult(-5510, fmt::format("{}CreateGeometry2DAction: Could not allocate SharedVertList '{}'", prefix, vertexPath.toString())));
}
Float32Array* vertexArray = ArrayFromPath<float>(dataStructure, vertexPath);
geometry2d->setVertices(*vertexArray);
Expand Down
4 changes: 2 additions & 2 deletions src/simplnx/Filter/Actions/CreateGeometry3DAction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class CreateGeometry3DAction : public IDataCreationAction
Result result = CreateArray<MeshIndexType>(dataStructure, cellTupleShape, {Geometry3DType::k_NumVerts}, cellsPath, mode, m_CreatedDataStoreFormat);
if(result.invalid())
{
return MakeErrorResult(-5609, fmt::format("{}CreateGeometry3DAction: Could not allocate SharedCellList '{}'", prefix, cellsPath.toString()));
return MergeResults(result, MakeErrorResult(-5609, fmt::format("{}CreateGeometry3DAction: Could not allocate SharedCellList '{}'", prefix, cellsPath.toString())));
}
SharedCellList* polyhedronList = ArrayFromPath<MeshIndexType>(dataStructure, cellsPath);
geometry3d->setPolyhedraList(*polyhedronList);
Expand All @@ -213,7 +213,7 @@ class CreateGeometry3DAction : public IDataCreationAction
result = CreateArray<float>(dataStructure, vertexTupleShape, {3}, vertexPath, mode, m_CreatedDataStoreFormat);
if(result.invalid())
{
return MakeErrorResult(-5610, fmt::format("{}CreateGeometry3DAction: Could not allocate SharedVertList '{}'", prefix, vertexPath.toString()));
return MergeResults(result, MakeErrorResult(-5610, fmt::format("{}CreateGeometry3DAction: Could not allocate SharedVertList '{}'", prefix, vertexPath.toString())));
}
Float32Array* vertexArray = ArrayFromPath<float>(dataStructure, vertexPath);
geometry3d->setVertices(*vertexArray);
Expand Down

0 comments on commit eed0c9b

Please sign in to comment.