Merge topic 'fix/replace-stl-with-vtkm-exception'

f9eab2eee Replace STL exception in contour tree with VTKM exception

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2531
This commit is contained in:
Gunther Weber 2021-07-16 16:22:45 +00:00 committed by Kitware Robot
commit 1485af6e87
3 changed files with 8 additions and 5 deletions

@ -98,6 +98,7 @@
#include <vtkm/cont/ArrayHandlePermutation.h>
#include <vtkm/cont/ArrayHandleTransform.h>
#include <vtkm/cont/ArrayPortalToIterators.h>
#include <vtkm/cont/Error.h>
#include <vtkm/cont/Invoker.h>
@ -394,7 +395,7 @@ inline void ActiveGraph::MakeMergeTree(MergeTree& tree, MeshExtrema& meshExtrema
// we check just to make absolutely sure we won't get stuck in an infinite loop
if (this->NumIterations >= maxNumIterations)
{
throw new std::domain_error("Bad iteration. Merge tree unable to process all edges.");
throw new vtkm::cont::ErrorInternal("Bad iteration. Merge tree unable to process all edges.");
}
// find & label the extrema with their governing saddles

@ -97,6 +97,7 @@
#include <vtkm/cont/ArrayHandleIndex.h>
#include <vtkm/cont/ArrayHandlePermutation.h>
#include <vtkm/cont/ArrayHandleTransform.h>
#include <vtkm/cont/Error.h>
#include <vtkm/cont/Invoker.h>
@ -225,8 +226,8 @@ inline void ContourTreeMaker::ComputeHyperAndSuperStructure()
// Raise error if we have done more itertions than there are active nodes to remove
if (this->ContourTreeResult.NumIterations >= maxNumIterations)
{
throw new std::domain_error("Bad iteration. This can happen if the input mesh "
"defines a contour forest rather than a simple tree.");
throw new vtkm::cont::ErrorInternal("Bad iteration. This can happen if the input mesh "
"defines a contour forest rather than a simple tree.");
}
} // loop until no active vertices remaining

@ -54,6 +54,7 @@
#define vtk_m_worklet_contourtree_distributed_computedistributedcontourtreefunctor_h
#include <vtkm/Types.h>
#include <vtkm/cont/Error.h>
#include <vtkm/worklet/contourtree_augmented/Types.h>
#include <vtkm/worklet/contourtree_distributed/DistributedContourTreeBlockData.h>
#include <vtkm/worklet/contourtree_distributed/PrintGraph.h>
@ -239,7 +240,7 @@ public:
}
// In case the contour tree got stuck, expand the debug information from
// the message to check whether we combined bad blocks
catch (const std::domain_error& ex)
catch (const vtkm::cont::ErrorInternal& ex)
{
std::stringstream ex_message;
ex_message << ex.what();
@ -257,7 +258,7 @@ public:
<< otherBlockSize[2] << ")";
ex_message << " Size Comb=(" << currBlockSize[0] << ", " << currBlockSize[1] << ", "
<< currBlockSize[2] << ")";
std::throw_with_nested(std::domain_error(ex_message.str()));
std::throw_with_nested(vtkm::cont::ErrorInternal(ex_message.str()));
}
// Update block extents