# vtkErrorMacro with loguru now caught

**URL:** <https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968>\
**Category:** Development\
**Created:** [January 8, 2021, 1:35pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968 "2021-01-08T13:35:41Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)\
**Post date:** [January 8, 2021, 1:35pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/1 "2021-01-08T13:35:41Z")

</div>

A year or two ago, an effort was made to make sure that `vtkErrorMacro` codepaths would cause a test to fail. Bill Lorensen wrote the `vtkTestErrorObserver` class which may be used to capture errors from a specific `vtkObject` and be used to ensure that a specific error does show up. This worked well until `loguru` started being used which made the error messages not match the old logger’s output format.

The new error format was not caught by the “did an error happen?” regex and numerous new ones have shown up in the meantime. This has been resolved recently (see [this MR](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7331)) and we have a number of tests which have error messages leaking out. It is unknown if some of these errors are expected (in which case `vtkTestErrorObserver` should be used) or if they are real errors that need addressed.

The list of tests which seem [to be affected](https://open.cdash.org/viewTest.php?onlyfailed&buildid=6970332):

(`[]` == unclaimed, `[x]` == claimed, `[X]` == fixed)

- [x] VTK::FiltersModelingCxx-UnitTestHausdorffDistancePointSetFilter
- [] VTK::ImagingCorePython-imageMCAll
- [] VTK::IOADIOS2Cxx-TestIOADIOS2VTX\_VTI3D
- [] VTK::IOADIOS2Cxx-TestIOADIOS2VTX\_VTU3D
- [X] VTK::FiltersCoreCxx-TestExplicitStructuredGridCrop
- [X] VTK::FiltersCoreCxx-TestUnstructuredGridToExplicitStructuredGrid
- [X] VTK::FiltersCoreCxx-TestUnstructuredGridToExplicitStructuredGridEmpty
- [x] VTK::FiltersHyperTreeCxx-TestHyperTreeGridBinary2DVector
- [x] VTK::FiltersHyperTreeCxx-TestHyperTreeGridBinaryEllipseMaterial
- [x] VTK::FiltersHyperTreeCxx-TestHyperTreeGridBinaryHyperbolicParaboloidMaterial
- [x] VTK::FiltersHyperTreeCxx-TestHyperTreeGridTernary3DAxisClipBox
- [x] VTK::FiltersHyperTreeCxx-TestHyperTreeGridTernary3DGeometryLargeMaterialBits
- [x] VTK::FiltersHyperTreeCxx-TestHyperTreeGridTernaryHyperbola
- [x] VTK::FiltersSourcesCxx-TestCapsuleSource
- [x] VTK::IOExportCxx-X3DTest
- [x] VTK::IOXMLPython-TestEmptyXML
- [x] VTK::IOXMLPython-TestWriteReadRandomHyperTreeGridAppendBinaryMode1
- [X] VTK::AcceleratorsVTKmFiltersCxx-TestVTKMCoordinateSystemTransform
- [X] VTK::AcceleratorsVTKmFiltersCxx-TestVTKMHistogram
- [X] VTK::AcceleratorsVTKmFiltersCxx-TestVTKMNDHistogram
- [X] VTK::InteractionWidgetsCxx-TestCoincidentHandleWidgets
- [X] VTK::InteractionWidgetsCxx-TestPointHandleRepresentation3D

If developers could please take a test or set of tests to investigate, that would be immensely helpful.

Thanks,

@ben.boeckel @sankhesh @utkarshayachit

---

<div class="post-metadata">

**Author:** ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)\
**Post date:** [January 8, 2021, 2:32pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/2 "2021-01-08T14:32:39Z")

</div>

@Yohann_Bearzi could you please look at the hyper tree grid tests?

@Chuck_Atkins could you please look at the ADIOS tests?

I will tackle the following:

```auto
VTK::FiltersCoreCxx-TestExplicitStructuredGridCrop
VTK::FiltersCoreCxx-TestUnstructuredGridToExplicitStructuredGrid
VTK::FiltersCoreCxx-TestUnstructuredGridToExplicitStructuredGridEmpty
VTK::FiltersSourcesCxx-TestCapsuleSource
VTK::IOExportCxx-X3DTest
VTK::IOXMLPython-TestEmptyXML

```

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [January 8, 2021, 2:35pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/3 "2021-01-08T14:35:56Z")

</div>

```
VTK::FiltersCoreCxx-TestExplicitStructuredGridCrop
VTK::FiltersCoreCxx-TestUnstructuredGridToExplicitStructuredGrid
VTK::FiltersCoreCxx-TestUnstructuredGridToExplicitStructuredGridEmpty

```

I think that’s for us.

---

<div class="post-metadata">

**Author:** ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)\
**Post date:** [January 8, 2021, 2:36pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/4 "2021-01-08T14:36:17Z")

</div>

Go for it 🙂

---

<div class="post-metadata">

**Author:** ![Yohann\_Bearzi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yohann_bearzi/32/671_2.png) [@Yohann\_Bearzi](https://discourse.vtk.org/u/Yohann_Bearzi)\
**Post date:** [January 8, 2021, 2:43pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/5 "2021-01-08T14:43:20Z")

</div>

Looking at it.

---

<div class="post-metadata">

**Author:** ![RobertMaynard](https://discourse.vtk.org/user_avatar/discourse.vtk.org/robertmaynard/32/24_2.png) [@RobertMaynard](https://discourse.vtk.org/u/RobertMaynard)\
**Post date:** [January 8, 2021, 2:44pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/6 "2021-01-08T14:44:55Z")

</div>

I will tackle the following:

```auto
VTK::AcceleratorsVTKmFiltersCxx-TestVTKMCoordinateSystemTransform
VTK::AcceleratorsVTKmFiltersCxx-TestVTKMHistogram
VTK::AcceleratorsVTKmFiltersCxx-TestVTKMNDHistogram

```

---

<div class="post-metadata">

**Author:** ![Aron\_Helser](https://discourse.vtk.org/user_avatar/discourse.vtk.org/aron_helser/32/14_2.png) [@Aron\_Helser](https://discourse.vtk.org/u/Aron_Helser)\
**Post date:** [January 8, 2021, 3:58pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/7 "2021-01-08T15:58:52Z")

</div>

> [@ben.boeckel](#):
>
> VTK::ImagingCorePython-imageMCAll

This one looks like the errors should just be ignored - but it’s a python test. How do we use `vtkTestErrorObserver` there?

---

<div class="post-metadata">

**Author:** ![sankhesh](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sankhesh/32/73_2.png) [@sankhesh](https://discourse.vtk.org/u/sankhesh)\
**Post date:** [January 8, 2021, 4:27pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/8 "2021-01-08T16:27:49Z")

</div>

> [@ben.boeckel](#):
>
> - VTK::InteractionWidgetsCxx-TestCoincidentHandleWidgets
> - VTK::InteractionWidgetsCxx-TestPointHandleRepresentation3D

I’ll look into these.

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)\
**Post date:** [January 8, 2021, 7:20pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/9 "2021-01-08T19:20:53Z")

</div>

Hrm. Good point. I guess we need a Python version of the class. I’ll look into it.

---

<div class="post-metadata">

**Author:** ![RobertMaynard](https://discourse.vtk.org/user_avatar/discourse.vtk.org/robertmaynard/32/24_2.png) [@RobertMaynard](https://discourse.vtk.org/u/RobertMaynard)\
**Post date:** [January 8, 2021, 7:23pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/10 "2021-01-08T19:23:59Z")

</div>

Merge Request open to fix the VTK-m related failing tests:

[https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/7517](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7517)

---

<div class="post-metadata">

**Author:** ![sankhesh](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sankhesh/32/73_2.png) [@sankhesh](https://discourse.vtk.org/u/sankhesh)\
**Post date:** [January 8, 2021, 8:04pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/11 "2021-01-08T20:04:26Z")

</div>

This has been fixed.

> [@vtkErrorMacro with loguru now caught](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/8):
>
> I’ll look into these.

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)\
**Post date:** [January 8, 2021, 8:08pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/12 "2021-01-08T20:08:28Z")

</div>

I’ve written an error observer for Python in [this MR](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7518). Building locally to test it now.

---

<div class="post-metadata">

**Author:** ![Yohann\_Bearzi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yohann_bearzi/32/671_2.png) [@Yohann\_Bearzi](https://discourse.vtk.org/u/Yohann_Bearzi)\
**Post date:** [January 8, 2021, 8:18pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/13 "2021-01-08T20:18:23Z")

</div>

HTG fixes are [here](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7519)

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [January 11, 2021, 2:22pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/14 "2021-01-11T14:22:26Z")

</div>

ExplicitGrid fixes are here (unrelated to ESG actually): [https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/7523](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7523)

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)\
**Post date:** [January 11, 2021, 4:44pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/15 "2021-01-11T16:44:42Z")

</div>

`master` now has a Python variant as `from vtkmodules.test.ErrorObserver import vtkErrorObserver`.

---

<div class="post-metadata">

**Author:** ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)\
**Post date:** [January 18, 2021, 11:22am UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/16 "2021-01-18T11:22:35Z")

</div>

The dashboard is still burning.,… is anyone looking at UnitTestHausdorffDistancePointSetFilter ? If I don’t hear anything by Monday noon I’ll take a look.

---

<div class="post-metadata">

**Author:** ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)\
**Post date:** [January 18, 2021, 1:36pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/17 "2021-01-18T13:36:16Z")

</div>

It doesn’t look like anyone claimed `UnitTestHausdorffDistancePointSetFilter` yet.

---

<div class="post-metadata">

**Author:** ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)\
**Post date:** [January 18, 2021, 1:38pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/18 "2021-01-18T13:38:33Z")

</div>

I took care of it, and Utkarsh updated Ben’s TODO list. We are down to just a few now…

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [January 18, 2021, 6:21pm UTC](https://discourse.vtk.org/t/vtkerrormacro-with-loguru-now-caught/4968/19 "2021-01-18T18:21:52Z")

</div>

Mines are fixed, i’ve updated the list.
